]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: htx: remove the EOM flag from a DATA block truncated by htx_truncate()
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 3 Dec 2026 16:23:51 +0000 (17:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Dec 2026 13:54:03 +0000 (14:54 +0100)
htx_truncate() removes all blocks after the one containing the given
offset, and truncates this last one if it is a DATA block. But the
truncated block kept its flags, including HTX_BLK_FL_EOM. So a message
truncated in the middle of its last DATA block was still considered as
complete.

Now, the EOM flag is removed from the truncated block.

This patch must be backported to 3.5.

src/htx.c

index 29e419d40e5434f08372cc86933fa7066f66d5f7..bda321397fe92dc1270a7b30442d2042e708043c 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -530,7 +530,11 @@ void htx_truncate(struct htx *htx, uint32_t offset)
 
        blk = htxret.blk;
        if (blk && htxret.ret && htx_is_data_type(htx_get_blk_type(blk))) {
+               /* The block is truncated, so it cannot carry the EOM flag
+                * anymore: the message is not complete.
+                */
                htx_change_blk_value_len(htx, blk, htxret.ret);
+               blk->flags &= ~HTX_BLK_FL_EOM;
                blk = htx_get_next_blk(htx, blk);
        }
        while (blk)