]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats/htx: Call channel_add_input instead of updating channel state by hand
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 2 Jan 2019 13:34:39 +0000 (14:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 2 Jan 2019 19:12:47 +0000 (20:12 +0100)
This way we are sure the channel state is always correctly upadated, especially
the amount of data directly forwarded. For the stats applet, it is not a bug
because the fast forwarding is never used (the response is chunked and the HTX
extra field is always set to 0).

This patch must be backported to 1.9.

src/stats.c

index f69aa90abd9baaf8942838a7d0f20f8b4190dc7e..bb6fa47f05ee6f47493e3eb9b0bb7d1a225481d1 100644 (file)
@@ -245,10 +245,8 @@ static int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk
        if (htx) {
                if (!htx_add_data(htx, ist2(chk->area, chk->data)))
                        return 0;
-               chn->total += chk->data;
+               channel_add_input(chn, chk->data);
                chk->data = 0;
-               /* notify that some data was read from the SI into the buffer */
-               chn->flags |= CF_READ_PARTIAL;
        }
        else  {
                if (ci_putchk(chn, chk) == -1)