]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: peers: correctly configure the client timeout
authorWilly Tarreau <w@1wt.eu>
Fri, 13 Mar 2015 15:18:25 +0000 (16:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Mar 2015 15:21:28 +0000 (16:21 +0100)
The peers frontend timeout was mistakenly set on timeout.connect instead
of timeout.client, resulting in no timeout being applied to the peers
connections. The impact is just that peers can establish connections and
remain connected until they speak. Once they start speaking, only one of
them will still be accepted, and old sessions will be killed, so the
problem is limited. This fix should however be backported to 1.5 since
it was introduced in 1.5-dev3 with peers.

src/cfgparse.c

index 2ebc9513737b5ee6c84bc93a436ab7f23ce7e0f8..8d7efb32e1f1754c2557050c16e30ebd2b700bec 100644 (file)
@@ -1867,7 +1867,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
                                curpeers->peers_fe->cap = PR_CAP_FE;
                                curpeers->peers_fe->maxconn = 0;
                                curpeers->peers_fe->conn_retries = CONN_RETRIES;
-                               curpeers->peers_fe->timeout.connect = 5000;
+                               curpeers->peers_fe->timeout.client = MS_TO_TICKS(5000);
                                curpeers->peers_fe->accept = peer_accept;
                                curpeers->peers_fe->options2 |= PR_O2_INDEPSTR | PR_O2_SMARTCON | PR_O2_SMARTACC;
                                curpeers->peers_fe->conf.args.file = curpeers->peers_fe->conf.file = strdup(file);