From: Olivier Houchard Date: Thu, 21 Mar 2019 14:48:46 +0000 (+0100) Subject: BUG/MEDIUM: mux-h2: Don't bother keeping the h2s if detaching and nothing to send. X-Git-Tag: v2.0-dev2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16ff261633ddae1b86f897ee2c14bd8fdda92401;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mux-h2: Don't bother keeping the h2s if detaching and nothing to send. In h2_detach(), don't bother keeping the h2s even if it was waiting for flow control if we no longer are subscribed for receiving or sending, as nobody will do anything once we can write in the mux, anyway. Failing to do so may lead to h2s being kept opened forever. This should be backported to 1.9. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 1169066103..f8b9ecc839 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3007,7 +3007,7 @@ static void h2_detach(struct conn_stream *cs) */ if (!(cs->conn->flags & CO_FL_ERROR) && (h2c->st0 < H2_CS_ERROR) && - (h2s->flags & (H2_SF_BLK_MBUSY | H2_SF_BLK_MROOM | H2_SF_BLK_MFCTL))) + (h2s->flags & (H2_SF_BLK_MBUSY | H2_SF_BLK_MROOM | H2_SF_BLK_MFCTL)) && (h2s->send_wait || h2s->recv_wait)) return; if ((h2c->flags & H2_CF_DEM_BLOCK_ANY && h2s->id == h2c->dsi) ||