]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux-h1: only mark C-L and T-E as sent once the header is emitted
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Sep 2026 04:39:07 +0000 (04:39 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Sep 2026 12:05:26 +0000 (14:05 +0200)
commit3d416630ceff56885d98fa823e9e88b2862f1a0e
treec3ab663a4a90a23665e813976cbd28323653436c
parent1afc7ca3ad95638080de70538ed75c3bf55f98e6
BUG/MINOR: mux-h1: only mark C-L and T-E as sent once the header is emitted

In h1_make_headers(), the H1S_F_HAVE_CLEN and H1S_F_HAVE_CHNK flags, and for
the content-length the message lengths, were set before the header was
formatted into the output buffer. If h1_format_htx_hdr() failed because the
buffer was full, the function stopped and left the header block in the HTX
message so that it was processed again on the next call, which was the
expected way to resume.

But then the flag was already set and the header was skipped as a
duplicate. h1_make_eoh() did not add it back either, since its check relied
on the same flags. The message would then be sent with a body but without
the header announcing its framing.

This requires the output buffer to be full in the middle of the headers. It
is not possible by construction for now. But this relies on the state of the
output buffer when a message starts.

Let's only set these flags and lengths once the header was emitted.

This may be backported to stable versions.
src/mux_h1.c