]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: flt-decomp: don't expose EOM before the end of decompression
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 17 Nov 2026 14:38:01 +0000 (15:38 +0100)
committerOlivier Houchard <cognet@ci0.org>
Tue, 17 Nov 2026 14:49:43 +0000 (15:49 +0100)
commitb9070950eddd3128c270e903f51890ddb212e78d
treef5f4a79f9bfb57c206bc8c56c5848a73686c6096
parent4219755072fd5f3637a159750f3e9a7a64c4468f
BUG/MEDIUM: flt-decomp: don't expose EOM before the end of decompression

When the last DATA block carries the EOM flag, which is the case for
Content-Length messages, the decompression filter replaces its compressed
data with the decompressed ones, but the block keeps the EOM flag. If all
the input data were consumed but the decompressed output could not be fully
drained into the buffer, the message is already seen as ended. The filter
is then no longer called and the pending output is lost, silently
truncating the message. Chunked messages are not affected because the EOM
flag is carried by the EOT block, which is held while data are pending.

Let's remove the EOM flag from any DATA block processed by the filter, and
save it in the filter context, so that it is restored once the
decompression is finished, as it is already done when a block is removed.

This was introduced by commit 40e5dff61 ("MAJOR: tree-wide: No longer use
HTX_FL_HAS_EOM to detect end of message"): before it, the end of message was
hidden during the decompression, but since it is carried by the tail block,
it is only saved when the block is removed. No backport is needed.
src/flt_decomp.c