]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: Don't report an error on shutr if a shutw is pending
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Oct 2023 17:30:02 +0000 (19:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Oct 2023 16:51:13 +0000 (18:51 +0200)
If a shutw is blocked because the mux is full or busy, we must defer the
shutr. In this case, the H2 stream is not in H2_SS_CLOSED state because the
shutw is also deferred. If the shutr is performed, this will lead to a
error.

Concretly, when the mux is unblocked, a RST_STREAM is sent while in some
cases, an empty DATA frame with ES flag set could be sent.

This patch should be backported to all stable versions.

src/mux_h2.c

index 67501738d75a0e297d06698a952c86056d3c4b92..a8f7792e94d61b7d084f7bd54f8e034a58a0a1dd 100644 (file)
@@ -4663,6 +4663,9 @@ static void h2_do_shutr(struct h2s *h2s)
 
        TRACE_ENTER(H2_EV_STRM_SHUT, h2c->conn, h2s);
 
+       if (h2s->flags & H2_SF_WANT_SHUTW)
+               goto add_to_list;
+
        /* a connstream may require us to immediately kill the whole connection
         * for example because of a "tcp-request content reject" rule that is
         * normally used to limit abuse. In this case we schedule a goaway to