]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: Refresh the conn-stream and the connection after a connect
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 May 2020 09:14:50 +0000 (11:14 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 May 2020 11:36:30 +0000 (13:36 +0200)
When a connect rule is evaluated, the conn-stream and the connection must be
refreshed in tcpcheck_main(). Otherwise, in case of synchronous connect, these
variables point on outdated values (NULL for the first connect or released
otherwise).

No backport needed.

src/checks.c

index c3d117ec62d0a79b9fa8cdc163d65f74105707b1..d377b17a4812ac4ea8f998b82fc967595c419b1e 100644 (file)
@@ -2721,6 +2721,10 @@ static int tcpcheck_main(struct check *check)
                                retcode = -1; /* do not reuse the fd in the caller! */
                        }
                        eval_ret = tcpcheck_eval_connect(check, rule);
+
+                       /* Refresh conn-stream and connection */
+                       cs = check->cs;
+                       conn = cs_conn(cs);
                        must_read = 1; last_read = 0;
                        break;
                case TCPCHK_ACT_SEND: