From: Christopher Faulet Date: Tue, 12 May 2020 13:05:43 +0000 (+0200) Subject: BUG/MEDIUM: checks: Subscribe to I/O events only if a mux was installed X-Git-Tag: v2.2-dev8~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b3a2dfed5f88bf832c9b0e536c6a483fdb2f180;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: checks: Subscribe to I/O events only if a mux was installed In the commit 2fabd9d53 ("BUG/MEDIUM: checks: Subscribe to I/O events on an unfinished connect"), we force the subscribtion to I/O events when a new connection is opened if it is not fully established. But it must only be done if a mux was immediately installed. If there is no mux, no subscription must be performed. No backport needed. --- diff --git a/src/checks.c b/src/checks.c index 901deb991f..d22c113100 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1891,10 +1891,12 @@ static enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct /* don't do anything until the connection is established */ if (conn->flags & CO_FL_WAIT_XPRT) { - if (next && next->action == TCPCHK_ACT_SEND) - conn->mux->subscribe(cs, SUB_RETRY_SEND, &check->wait_list); - else - conn->mux->subscribe(cs, SUB_RETRY_RECV, &check->wait_list); + if (conn->mux) { + if (next && next->action == TCPCHK_ACT_SEND) + conn->mux->subscribe(cs, SUB_RETRY_SEND, &check->wait_list); + else + conn->mux->subscribe(cs, SUB_RETRY_RECV, &check->wait_list); + } ret = TCPCHK_EVAL_WAIT; goto out; }