]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: h2: Destroy a connection with no stream if it has no owner.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 30 Nov 2018 14:39:16 +0000 (15:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 09:47:18 +0000 (10:47 +0100)
In h2_detach(), if the connection has no stream left, and no associated
owner, then destroy it, as nobody else will be able to.

src/mux_h2.c

index 336bd4e0f906d1aa388b8ab38fcb846752318deb..c91905f92caa745014018524b30c3ab27e429c8d 100644 (file)
@@ -2622,6 +2622,7 @@ static void h2_detach(struct conn_stream *cs)
            ((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 | H2_CF_GOAWAY_SENT)) ||
+            (!(h2c->conn->owner)) || /* Nobody's left to take care of the connection, drop it now */
             (!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))))) {