]> git.ipfire.org Git - thirdparty/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:30:26 +0000 (10:30 +0100)
commitf1e1cb463f12b2d5761ae97cd24f8b00b7d65340
tree95630cc7163c5d363dc5dc1dd71e8c3e4f470697
parent0f68eaca1a40c6dd542af3bfd2e77aec724d4b64
[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