BUG/MINOR: stats: fix source buffer size for http dump
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 3 Feb 2023 07:31:42 +0000 (08:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Feb 2023 06:53:03 +0000 (07:53 +0100)
commit14656844cc68794d0c6994c10a07a5f7ebce50f6
tree511dc0b5fd8e4be02c102e90c5adab8d7b8cd210
parente74d77b301116633d6ba57d8f53f588b1e68652b
BUG/MINOR: stats: fix source buffer size for http dump

In ("BUG/MINOR: stats: use proper buffer size for http dump"),
we used trash.size as source buffer size before applying the htx
overhead computation.

It is safer to use res->buf.size instead since res_htx (which is <htx> argument
passed to stats_putchk() in http context) is made from res->buf:

in http_stats_io_handler:
    | res_htx = htx_from_buf(&res->buf);

This will prevent the hang bug from showing up again if res->buf.size were to be
less than trash.size (which is set according to tune.bufsize).

This should be backported with ("BUG/MINOR: stats: use proper buffer size for http dump")
src/stats.c