]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h1: Make sure we destroy an inactive connectin that did shutw.
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 14 Jan 2019 16:27:23 +0000 (17:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jan 2019 17:14:52 +0000 (18:14 +0100)
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.

src/mux_h1.c

index 17674c7224d3d0537dfff4236b657c945c508b1b..4b0f46b635c6a2f9be0cc57190ee674bb42417a9 100644 (file)
@@ -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)