BUG/MEDIUM: mux-h2: Don't send RST_STREAM frame for streams with no ID
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Nov 2024 09:25:20 +0000 (10:25 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Nov 2024 09:34:47 +0000 (10:34 +0100)
commitf065d0009888c394e5f93dfdaa2ae79958b2c2e2
treeedc8c36e8bbe60a7a87337380809c2e26f7487fe
parent4fd6d15344340b7a7f6e018841b90b5bdc85a1f1
BUG/MEDIUM: mux-h2: Don't send RST_STREAM frame for streams with no ID

On server side, the H2 stream is first created with an unassigned ID (ID ==
0). Its ID is assigned when the request is emitted, before formatting the
HEADERS frame. However, the session may be aborted during that stage. We
must take care to not emit RST_STREAM frame for this stream, because it does
not exist yet for the server.

It is especially important to do so because, depending on the timing, it may
also happens before the H2 PREFACE was sent.

This patch must be backported to all stable versions. It is related to issue
src/mux_h2.c