]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: mux-h1: Discard pending raw data after a tunnel rejection
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Sep 2026 12:20:26 +0000 (14:20 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Sep 2026 12:41:25 +0000 (14:41 +0200)
commit04456142e3ed1d8b5a7d3d39861ee6529458fca7
tree3a2854631da1246fcbf045d557c58978381c6483
parent1e0478331e0b3dd84daf8e3be731e65411c2b1be
BUG/MINOR: mux-h1: Discard pending raw data after a tunnel rejection

When a backend rejects a CONNECT request, some early tunnel data may
still be pending in the request buffer. Once the response is complete,
output processing is unblocked with both messages in DONE state. Trying
to process the pending data then reports a processing error, although
these data may legitimately have been sent before the client learned
about the rejection.

Discard RAW_DATA blocks in this situation instead of reporting an error.
Only the backend path with both messages in DONE state does this, and
other block types are still rejected. No discarded bytes are written to
the server connection, so they cannot contaminate a subsequent request.

The discard operation respects the requested byte count. Also exempt
pending raw request data from the final DONE-state error check: a partial
discard, output congestion or allocation failure may leave such data to
be processed on a later call. Without this exception, consuming only part
of a raw block would still report the same processing error.

Successful tunnels and the response path keep their existing behavior.
This implementation relies on RAW_DATA blocks and is only intended for
3.5; it must not be applied as-is to older branches.
src/mux_h1.c