]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: htx: Don't reset flags when source must be preserved during transfer
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 22 Jul 2026 08:59:57 +0000 (10:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Sep 2026 08:23:54 +0000 (10:23 +0200)
When htx_xfer() is called with HTX_XFER_KEEP_SRC_BLKS flag, to preserve
blocks from the source HTX message, the source flags must not be reset at
the end of the transfer.

This bug can be triggered with L7-retries are configured with small
buffers. In that case, the HTX_FL_EOM flag is removed from the request
fowarded to the backend multiplexer.

This patch must be backported to 3.4.

src/htx.c

index 1fe5c85cff7f31a0774b4a3ae371d19c9512f669..ba1ca7201d522b2dc71f8b44bbb371a130bd7829 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -893,7 +893,8 @@ size_t htx_xfer(struct htx *dst, struct htx *src, size_t count, unsigned int fla
        /* Everything was copied, transfer terminal HTX flags too */
        if (!blk) {
                dst->flags |= (src->flags & (HTX_FL_EOM|HTX_FL_PARSING_ERROR|HTX_FL_PROCESSING_ERROR));
-               src->flags = 0;
+               if (!(flags & HTX_XFER_KEEP_SRC_BLKS))
+                       src->flags = 0;
        }
 
        return ret;