]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] do not apply timeout.connect in checks if unset
authorWilly Tarreau <w@1wt.eu>
Sun, 17 Feb 2008 10:34:10 +0000 (11:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 17 Feb 2008 10:34:10 +0000 (11:34 +0100)
tv_bound() does not consider infinite timeouts, so we must
check that timeout.connect is set before applying it to the
checks.

src/checks.c

index 0fbe166789bc7d42d76ba12cd65ae88bac642e1d..1a5bf71608b15373c29020db7d97a199774d64fd 100644 (file)
@@ -496,11 +496,12 @@ void process_chk(struct task *t, struct timeval *next)
                                                 * to establish but only when timeout.check is set
                                                 * as it may be to short for a full check otherwise
                                                 */
-                                               tv_add(&tv_con, &now, &s->proxy->timeout.connect);
                                                tv_ms_add(&t->expire, &now, s->inter);
 
-                                               if (tv_isset(&s->proxy->timeout.check))
+                                               if (tv_isset(&s->proxy->timeout.check) && tv_isset(&s->proxy->timeout.connect)) {
+                                                       tv_add(&tv_con, &now, &s->proxy->timeout.connect);
                                                        tv_bound(&t->expire, &tv_con);
+                                               }
 
                                                task_queue(t);  /* restore t to its place in the task list */
                                                *next = t->expire;