]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: Close connection if no stream is left an GOAWAY was sent.
authorOlivier Houchard <cognet@ci0.org>
Sun, 21 Oct 2018 01:01:20 +0000 (03:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Oct 2018 03:53:09 +0000 (05:53 +0200)
When we're closing a stream, is there's no stream left and a goaway was sent,
close the connection, there's no reason to keep it open.

[wt: it's likely that this is needed in 1.8 as well, though it's unclear
 how to trigger this issue, some tests are needed]

src/mux_h2.c

index 4fe811af4b0ce0b26f0235d82188466ed7a4957d..ae885d9337a8e84ccdd9a986e1ff57f505659577 100644 (file)
@@ -2649,7 +2649,7 @@ static void h2_detach(struct conn_stream *cs)
        if (eb_is_empty(&h2c->streams_by_id) &&     /* don't close if streams exist */
            ((h2c->conn->flags & CO_FL_ERROR) ||    /* errors close immediately */
             (h2c->st0 >= H2_CS_ERROR && !h2c->task) || /* a timeout stroke earlier */
-            (h2c->flags & H2_CF_GOAWAY_FAILED) ||
+            (h2c->flags & (H2_CF_GOAWAY_FAILED | H2_CF_GOAWAY_SENT)) ||
             (!b_data(&h2c->mbuf) &&  /* mux buffer empty, also process clean events below */
              (conn_xprt_read0_pending(h2c->conn) ||
               (h2c->last_sid >= 0 && h2c->max_id >= h2c->last_sid))))) {