]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tcpcheck connect wrong behavior
authorBaptiste Assmann <bedis9@gmail.com>
Mon, 3 Feb 2014 21:38:15 +0000 (22:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Feb 2014 22:50:02 +0000 (23:50 +0100)
A typo made first step of a tcpcheck to be a connect step. This patch
prevents this behavior. The bug was introduced in 1.5-dev22 with
"tcp-check connect" and only affects these directives. No backport is
needed.

src/checks.c

index c3051aa43baf0a4cf2d8470d6fd6f682bcd95da1..80f0bc0d309c26b78740f1eef96d053b53dedfd2 100644 (file)
@@ -1578,8 +1578,12 @@ static struct task *process_chk(struct task *t)
                }
 
                if (check->type == PR_O2_TCPCHK_CHK) {
-                       tcpcheck_main(conn);
-                       return t;
+                       struct tcpcheck_rule *r = (struct tcpcheck_rule *) s->proxy->tcpcheck_rules.n;
+                       /* if first step is a 'connect', then tcpcheck_main must run it */
+                       if (r->action == TCPCHK_ACT_CONNECT) {
+                               tcpcheck_main(conn);
+                               return t;
+                       }
                }