]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h1: accept a late EOM on content-length messages
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:33:36 +0000 (14:33 +0100)
commitbf2aeea3fdf5b8c4e42fd47ef1e5e8fe1333c2ee
tree14d1d7ad862ee55884db78b67a50f0987cf7b13a
parent1eec7f6505271be719324d62e432bee04ecab110
BUG/MEDIUM: mux-h1: accept a late EOM on content-length messages

When the last bytes of a message with a content-length are sent by the
zero-copy path of h1_make_data() or by h1_done_ff() before the EOM is
known, the message is switched to H1_MSG_TRAILERS. If the EOM then comes
alone on a NOOP block, h1_make_trailers() reports a processing error.
This happens when an H2 peer sends END_STREAM in a separate empty DATA
frame after the payload was already forwarded, e.g. a node client piping
a stream into a request with a content-length: the client gets a 500
with "IH--" although the server received the whole request. With an H2
server doing the same, the response is logged with "ID--" and the client
connection is not kept alive.

Let's end the message when a NOOP block carrying the EOM is found in
h1_make_trailers() and the message is not chunked. It remains an error
for chunked messages, for which the EOM is expected on the EOT block.
This was brought in 3.5-dev14 by commit e99253b70 ("BUG/MINOR: mux-h1:
properly handle NOOP blocks and track EOM emission"), so no backport is
needed.
src/mux_h1.c