]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: servers: Close the connection if we failed to install the mux.
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 29 Jan 2019 18:11:16 +0000 (19:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Jan 2019 18:53:09 +0000 (19:53 +0100)
If we failed to install the mux, just close the connection, or
conn_fd_handler() will be called for the FD, and crash as soon as it attempts
to access the mux' wake method.

This should be backported to 1.9.

src/backend.c

index 82c71c4febb7f4a4301f64b7492cd5a725797a37..e4bd5bf54e00c39869fd973b9edec4d9cb9906a4 100644 (file)
@@ -1465,8 +1465,10 @@ int connect_server(struct stream *s)
         * fail, and flag the connection as CO_FL_ERROR.
         */
        if (init_mux) {
-               if (conn_install_mux_be(srv_conn, srv_cs, s->sess) < 0)
+               if (conn_install_mux_be(srv_conn, srv_cs, s->sess) < 0) {
+                       conn_full_close(srv_conn);
                        return SF_ERR_INTERNAL;
+               }
                /* If we're doing http-reuse always, and the connection
                 * is an http2 connection, add it to the available list,
                 * so that others can use it right away.