From: Olivier Houchard Date: Tue, 17 Nov 2026 14:38:01 +0000 (+0100) Subject: BUG/MEDIUM: flt-decomp: don't expose EOM before the end of decompression X-Git-Tag: v3.5-dev13~31 X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=b9070950eddd3128c270e903f51890ddb212e78d;p=haproxy.git 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. --- diff --git a/src/flt_decomp.c b/src/flt_decomp.c index 56de068d4..a46b0f510 100644 --- a/src/flt_decomp.c +++ b/src/flt_decomp.c @@ -251,6 +251,10 @@ static int decomp_stream_blk(struct stream *s, struct filter *f, struct channel case HTX_BLK_UNUSED: goto next; case HTX_BLK_DATA: + if (blk->flags & HTX_BLK_FL_EOM) { + blk->flags &= ~HTX_BLK_FL_EOM; + st->flags |= DECOMP_STATE_EOM_SEEN; + } val = htx_get_blk_value(htx, blk); val = istadv(val, offset); blk_remain = val.len;