From: Christopher Faulet Date: Mon, 13 Apr 2026 16:58:35 +0000 (+0200) Subject: BUG/MEDIUM: htx: Don't count delta twice when block value is replaced X-Git-Tag: v3.4-dev9~21 X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=7270bfcff528c06f693bad24a1eee8e2cf328fb2;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: htx: Don't count delta twice when block value is replaced A regression was introduced by the commit a8887e55a ("BUG/MEDIUM: htx: Fix function used to change part of a block value when defrag"). When a block value was replaced and a defragmentation was performed, the delta between the old value and the new one was counted twice. htx_defrag() already is responsible to set the new size for the HTX message. So it must not be performed in htx_replace_blk_value(). This patch must be backported with the commit above. So theorically to all stable versions. --- diff --git a/src/htx.c b/src/htx.c index 6ace1d3e8..295e46174 100644 --- a/src/htx.c +++ b/src/htx.c @@ -718,8 +718,6 @@ struct htx_blk *htx_replace_blk_value(struct htx *htx, struct htx_blk *blk, /* finally copy data */ htx_memcpy(htx_get_blk_ptr(htx, blk), b_orig(chunk), b_data(chunk)); free_trash_chunk(chunk); - - htx->data += delta; } return blk; }