]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: do not report available outgoing streams after GOAWAY
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Jan 2019 05:40:19 +0000 (06:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Jan 2019 05:44:53 +0000 (06:44 +0100)
The calculation of available outgoing H2 streams was improved by commit
d64a3ebe6 ("BUG/MINOR: mux-h2: always check the stream ID limit in
h2_avail_streams()"), but it still is incorrect because RFC7540#6.8
specifically forbids the creation of new streams after a GOAWAY frame
was received. Thus we must not mark the connection as available anymore
in order to be able to handle a graceful shutdown.

This needs to be backported to 1.9.

src/mux_h2.c

index 2972ca296bf296e9858d60b9f073d11448918d80..90895e288cec604d78f662251a7c2cdef3cd56b9 100644 (file)
@@ -415,6 +415,12 @@ static int h2_avail_streams(struct connection *conn)
        struct h2c *h2c = conn->ctx;
        int ret1, ret2;
 
+       /* RFC7540#6.8: Receivers of a GOAWAY frame MUST NOT open additional
+        * streams on the connection.
+        */
+       if (h2c->last_sid >= 0)
+               return 0;
+
        /* XXX Should use the negociated max concurrent stream nb instead of the conf value */
        ret1 = h2_settings_max_concurrent_streams - h2c->nb_streams;