]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: unsubscribe for events on the old conn-stream on connect
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 09:22:56 +0000 (11:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 09:22:57 +0000 (11:22 +0200)
When a new connection is established, if an old connection is still attached to
the current check, it must be detroyed. When it happens, the old conn-stream
must be used to unsubscribe for events, not the new one.

No backport is needed.

src/checks.c

index 15966c8131cca01477605eb6cd17d5e5e44ea289..efc9ce2295397b6cbb37c86246388761b247936c 100644 (file)
@@ -1660,7 +1660,8 @@ static enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct
        /* 3- release and replace the old one on success */
        if (check->cs) {
                if (check->wait_list.events)
-                       cs->conn->mux->unsubscribe(cs, check->wait_list.events, &check->wait_list);
+                       check->cs->conn->mux->unsubscribe(check->cs, check->wait_list.events,
+                                                         &check->wait_list);
 
                /* We may have been scheduled to run, and the I/O handler
                 * expects to have a cs, so remove the tasklet