]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: htx: preserve the first block when a message is moved to another buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 3 Dec 2026 20:43:37 +0000 (21:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Dec 2026 13:54:03 +0000 (14:54 +0100)
commit1d5b9dfafd34aeb2cb2d1866a22cdf9bc3956a34
tree07123fa5ce14b16e8995205f0ae6445099c45e85
parentbd69dcf068fd2fe384d74efbf43f640cc697ffcf
BUG/MINOR: htx: preserve the first block when a message is moved to another buffer

htx_move_to_large_buffer() and similar functions rely on htx_xfer() to
transfer an HTX message to a larger or smaller buffer. But htx_xfer() adds
new blocks in the destination message, so the first block to (re)start
the analysis from (htx->first) was always the head one. When some blocks
were before it in the source message, for instance an interim response
not forwarded yet, the wrong block was used as first block after the
transfer. For instance, after a "wait-for-body" action moving a response
to a large buffer, the next "http-response" rules could be evaluated on a
1xx response instead of the final one.

To fix the issue, a new xfer flag is added, HTX_XFER_KEEP_FIRST. When it
is set and the destination message is empty, the block copied from the
first block of the source message becomes the first block of the
destination message. This flag is now used by the functions moving or
copying a message to a small or large buffer.

This patch must be backported to 3.4.
include/haproxy/htx.h
src/htx.c