BUG/MEDIUM: checks: Check that conn_install_mux succeeded.

If conn_install_mux failed, then the connection has no mux and won't be
usable, so just give up is on failure instead of ignoring it.

This should be backported to 1.9.
This commit is contained in:
Olivier Houchard 2019-01-29 15:47:43 +01:00 committed by Willy Tarreau
parent f1e6fa35de
commit f67be93ae0

View File

@ -1625,7 +1625,8 @@ static int connect_conn_chk(struct task *t)
clear_addr(&conn->addr.from);
conn_prepare(conn, proto, check->xprt);
conn_install_mux(conn, &mux_pt_ops, cs, s->proxy, NULL);
if (conn_install_mux(conn, &mux_pt_ops, cs, s->proxy, NULL) < 0)
return SF_ERR_RESOURCE;
cs_attach(cs, check, &check_conn_cb);
/* only plain tcp-check supports quick ACK */
@ -2818,7 +2819,8 @@ static int tcpcheck_main(struct check *check)
}
conn_prepare(conn, proto, xprt);
conn_install_mux(conn, &mux_pt_ops, cs, proxy, NULL);
if (conn_install_mux(conn, &mux_pt_ops, cs, proxy, NULL) < 0)
return SF_ERR_RESOURCE;
cs_attach(cs, check, &check_conn_cb);
ret = SF_ERR_INTERNAL;