]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: mux-h2: don't send RST_STREAM for backend streams whose HEADERS were...
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Oct 2026 21:22:06 +0000 (23:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Nov 2026 19:48:35 +0000 (20:48 +0100)
commit42885be079dfe3744dfbb3a8605b78a1f2783324
treeec1349c5a94570b6ead3b2ebae013e38d78f74d7
parent01bdaab38f54f2bd46fb035924ef9a6e60979460
BUG/MEDIUM: mux-h2: don't send RST_STREAM for backend streams whose HEADERS were not sent

On the backend side, h2_snd_buf() assigns the stream ID before calling
h2s_snd_bhdrs() to encode the HEADERS frame. If the encoding fails, the
the HEADERS frame is never sent and the stream is put in error, but an
RST_STREAM is sent for this ID. The same happens via h2_do_shutr()/
h2_do_shutw() when the stream is aborted while its HEADERS frame is
still blocked. But for the server, this stream is still idle, and the
H2 spec says that receiving an RST_STREAM on an idle stream must be
treated as a connection error, so a compliant server will then close
the connection with a GOAWAY(PROTOCOL_ERROR).

Commit f065d0009 ("BUG/MEDIUM: mux-h2: Don't send RST_STREAM frame for
streams with no ID") already addressed the case of streams without ID,
which was the first manifestation of this situation. Let's also skip
the RST_STREAM for backend streams which haven't sent their HEADERS
frame yet.

The protocol_upgrade reg-test, which expected the RST_STREAM on the idle
stream for requests which cannot be converted, was updated accordingly.

The issue has existed since outgoing streams were introduced in 1.9, so
the fix should be backported to all supported versions.
reg-tests/http-messaging/protocol_upgrade.vtc
src/mux_h2.c