From: Aurelien DARRAGON Date: Fri, 3 Feb 2023 07:31:42 +0000 (+0100) Subject: BUG/MINOR: stats: fix source buffer size for http dump X-Git-Tag: v2.8-dev4~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14656844cc68794d0c6994c10a07a5f7ebce50f6;p=thirdparty%2Fhaproxy.git 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 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") --- diff --git a/src/stats.c b/src/stats.c index 791b792797..2fdaaefb12 100644 --- a/src/stats.c +++ b/src/stats.c @@ -4458,7 +4458,7 @@ static void http_stats_io_handler(struct appctx *appctx) } if (appctx->st0 == STAT_HTTP_DUMP) { - trash_chunk = b_make(trash.area, trash.size, 0, 0); + trash_chunk = b_make(trash.area, res->buf.size, 0, 0); /* adjust buffer size to take htx overhead into account, * make sure to perform this call on an empty buffer */