MINOR: stats/htx: Call channel_add_input instead of updating channel state by hand

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.
This commit is contained in:
Christopher Faulet 2019-01-02 14:34:39 +01:00 committed by Willy Tarreau
parent e64582929f
commit 5adbeeb336

View 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)