]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: Rework slightly commit 9962f8fc to clean code and avoid mistakes
authorChristopher Faulet <christopher.faulet@capflam.org>
Tue, 28 Jun 2016 13:54:44 +0000 (15:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Jun 2016 14:34:50 +0000 (16:34 +0200)
commita9300a3d5a068c6e6c0a95f2a2640df557aa0a4c
treee4d11a24b59a28099fcd83aaa554028f20f1c15e
parent9962f8fc44dc9033ee076073c49bb826679d027b
BUG/MINOR: Rework slightly commit 9962f8fc to clean code and avoid mistakes

In commit 9962f8fc (BUG/MEDIUM: http: unbreak uri/header/url_param hashing), we
take care to update 'msg->sov' value when the parser changes to state
HTTP_MSG_DONE. This works when no filter is used. But, if a filter is used and
if it loops on 'http_end' callback, the following block is evaluated two times
consecutively:

    if (unlikely(!(chn->flags & CF_WROTE_DATA) || msg->sov > 0))
            msg->sov -= ret;

Today, in practice, because this happens when all data are parsed and forwarded,
the second test always fails (after the first update, msg->sov is always lower
or equal to 0). But it is useless and error prone. So to avoid misunderstanding
the code has been slightly changed. Now, in all cases, we try to update msg->sov
only once per iteration.

No backport is needed.
src/proto_http.c