]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: servers: Fail if we fail to allocate a conn_stream.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 28 Dec 2018 13:45:47 +0000 (14:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Dec 2018 14:49:24 +0000 (15:49 +0100)
If, for some reason we failed to allocate a conn_stream when reusing an
existing connection, set srv_conn to NULL, so that we fail later, instead
of pretending all is right. This ends up giving a stream_interface with
no endpoint, and so the stream will never end.

This should be backported to 1.9.

src/backend.c

index bc38c571040db42f02a2d89e403de93c39bd3622..d52f484cb6e5416195082134b63cd016b7047aaf 100644 (file)
@@ -1278,6 +1278,8 @@ int connect_server(struct stream *s)
                        srv_cs = srv_conn->mux->attach(srv_conn, s->sess);
                        if (srv_cs)
                                si_attach_cs(&s->si[1], srv_cs);
+                       else
+                               srv_conn = NULL;
                }
        }
        if (srv_conn && old_conn != srv_conn) {