From: Christopher Faulet Date: Tue, 28 Jul 2026 10:03:27 +0000 (+0200) Subject: BUG/MINOR: htx: Transfer HTX_FL_EOM flag on success in htx_append_msg() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1e656046a380e2554ae4fae73dad1fb4109a229;p=thirdparty%2Fhaproxy.git BUG/MINOR: htx: Transfer HTX_FL_EOM flag on success in htx_append_msg() htx_append_msg() function copy all blocks from a source message to a destination one. But it never take care to also transfer HTX_FL_EOM flag if necessary on success. It is important because this function is used to copy error messages during HTTP analysis. It seems to be harmless because when an error is triggered the stream is also closed and most of time a raw copy is performed instead of a block-per-block copy. But this could lead to prematurely close the connection at the end of the response. This patch should be backported to all supported versions. --- diff --git a/src/htx.c b/src/htx.c index 4d2d4cf95..1fe5c85cf 100644 --- a/src/htx.c +++ b/src/htx.c @@ -1344,7 +1344,8 @@ void htx_move_blk_before(struct htx *htx, struct htx_blk **blk, struct htx_blk * /* Append the HTX message to the HTX message . It returns 1 on * success and 0 on error. All the message or nothing is copied. If an error - * occurred, all blocks from already appended to are truncated. + * occurred, all blocks from already appended to are truncated. On + * success, the EOM flag is set on if also set on . */ int htx_append_msg(struct htx *dst, const struct htx *src) { @@ -1365,7 +1366,7 @@ int htx_append_msg(struct htx *dst, const struct htx *src) newblk->info = blk->info; htx_memcpy(htx_get_blk_ptr(dst, newblk), htx_get_blk_ptr(src, blk), blksz); } - + dst->flags |= (src->flags & HTX_FL_EOM); return 1; error: