]> git.kaiwu.me - haproxy.git/commit
[BUG]: Restore clearing t->logs.bytes
authorKrzysztof Piotr Oledzki <ole@ans.pl>
Sun, 20 Jan 2008 22:27:02 +0000 (23:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Jan 2008 09:26:27 +0000 (10:26 +0100)
commit89cacf7007b70f4f48f195d2649d8a0f0b53f6de
tree0d0fcac411a0696ad20ac9c3e5407aa9895a80ae
parent532bf552e1b4afc302b8bcae0e1ded1a68d0d4e0
[BUG]: Restore clearing t->logs.bytes

Commit 8b3977ffe36190e45fb974bf813bfbd935ac99a1 removed "t->logs.bytes_in = 0;"
but instead it should change it into "t->logs.bytes_out = 0;" as since
583bc966064e248771e75c253dddec7351afd8a2 counters are incremented not set.

It should be incremented in session_process_counters while sending data to a
client:
        bytes = s->rep->total - s->logs.bytes_out;
        s->logs.bytes_out = s->rep->total;

However, if we increment (set) s->logs.bytes_out while processing
"logasap", statistics get wrong values added for headers: 0 or even
negative if haproxy adds some headers itself.

To test it, please enable logasap and download one empty file and look at
stats. Without my fix information available on that page are invalid, for
example:

# pxname,svname,qcur,qmax,scur,smax,slim,stot,bin,bout,dreq,dresp,ereq,econ,eresp,wretr,wredis,status,weight,act,bck,chkfail,chkdown,lastchg,downtime,qlimit,pid,iid,sid,throttle,lbtot,
www,b,0,0,0,1,,1,24,-92,,0,,0,0,0,,UP,1,1,0,0,0,3121,0,,1,2,1,,1,
www,BACKEND,0,0,0,1,0,1,24,-92,0,0,,0,0,0,0,UP,1,1,0,,0,3121,0,,1,2,0,,1,
src/proto_http.c