]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h1: don't drop pending output on a short content-length
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 30 Oct 2026 15:04:33 +0000 (16:04 +0100)
committerOlivier Houchard <cognet@ci0.org>
Tue, 3 Nov 2026 13:58:48 +0000 (14:58 +0100)
commit8fc09da211773e0eb7a8de8b9dc458c9e2fd9f35
treeab24f9072c8efc0c1dad2b87c6d834b348cc555b
parent078e0aa87aae0bcb64ad53bf758a2f01dd9690fc
BUG/MEDIUM: mux-h1: don't drop pending output on a short content-length

When a fixed-length message is truncated and output data is still pending
in the H1 output buffer, h1s_destroy() flags the connection in error
because we got less data than expected, and so h1_send() will refuse to
send the remaining data, and not everything will be transmitted.

Now, when a truncated message is detected while output data is still
pending, H1C_F_ERROR is not set immediately, we just avoid adding it to
the idle pool, and the connection will be closed later when everything
has been sent.

To release the connection once the output buffer is drained, the
condition in h1_process() that only matched delayed silent shutdowns is
generalized to any connection in CLOSING state with an empty output
buffer. This covers both silent shutdowns and the short content-length
case. The connection is still not released while a stream remains
attached, since h1_close() keeps it in CLOSING until the stream is
detached.

This should be backported where 75dd2c18dda29f9893574ef982ddf66de16f0408
has been backported, up to 2.8.
src/mux_h1.c