]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: compression: finish the stream on a NOOP block with EOM
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 2 Dec 2026 13:47:18 +0000 (14:47 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 2 Dec 2026 13:37:31 +0000 (14:37 +0100)
Since commit 221c40bbf ("MINOR: htx: Add a noop block to carry the EOM
flag on an empty message"), the end of a message may come alone on a
NOOP block when it is received after the last data. comp_http_payload()
only finished the compression on a DATA block carrying the EOM or on a
TLR or EOT block, so in this case the compressed stream was never
finished while the response was sent as complete. This happens with an
H2 server sending END_STREAM in a separate empty DATA frame, or with a
FastCGI application ending its response after its last output. Some
clients accept such a stream, others report an unexpected end of file.

Let's handle a NOOP block carrying the EOM like the TLR and EOT blocks.
This was brought in 3.5-dev14, so no backport is needed.

src/flt_http_comp.c

index f8076ceeeb0597ff7ce9360751c0db46177f4941..310a8655d3b021308493a6f80957ae225a1e984a 100644 (file)
@@ -388,6 +388,10 @@ comp_http_payload(struct stream *s, struct filter *filter, struct http_msg *msg,
                                }
                                break;
 
+                       case HTX_BLK_NOOP:
+                               if (!(blk->flags & HTX_BLK_FL_EOM))
+                                       goto consume;
+                               __fallthrough;
                        case HTX_BLK_TLR:
                        case HTX_BLK_EOT:
                                if (htx_compression_buffer_end(st, out, 1, dir) < 0)