From: Olivier Houchard Date: Mon, 14 Jan 2019 16:27:23 +0000 (+0100) Subject: BUG/MEDIUM: h1: Make sure we destroy an inactive connectin that did shutw. X-Git-Tag: v2.0-dev1~217 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32d75ed30024a8b4b75fdf1032f208d378e8d049;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: h1: Make sure we destroy an inactive connectin that did shutw. In h1_process(), if we have no associated stream, and the connection got a shutw, then destroy it, it is unusable and it may be our last chance to do so. This should be backported to 1.9. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 17674c7224..4b0f46b635 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1844,7 +1844,7 @@ static int h1_process(struct h1c * h1c) if (!h1s) { if (h1c->flags & H1C_F_CS_ERROR || - conn->flags & CO_FL_ERROR || + conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH) || conn_xprt_read0_pending(conn)) goto release; if (!conn_is_back(conn) && !(h1c->flags & (H1C_F_CS_SHUTW_NOW|H1C_F_CS_SHUTDOWN))) { @@ -1861,7 +1861,7 @@ static int h1_process(struct h1c * h1c) if (!b_data(&h1c->ibuf) && h1s && h1s->cs && h1s->cs->data_cb->wake && (conn_xprt_read0_pending(conn) || h1c->flags & H1C_F_CS_ERROR || - conn->flags & CO_FL_ERROR)) { + conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH))) { int flags = 0; if (h1c->flags & H1C_F_CS_ERROR || conn->flags & CO_FL_ERROR)