[BUG] timeout.check was not pre-set to eternity
If timeout.check was not set, check were using 0 as the timeout, causing odd behaviours.
This commit is contained in:
parent
50fd1e1e3b
commit
3a70f94991
@ -2,7 +2,7 @@
|
||||
include/proto/proxy.h
|
||||
This file defines function prototypes for proxy management.
|
||||
|
||||
Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu
|
||||
Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -48,6 +48,19 @@ static inline const char *proxy_type_str(struct proxy *proxy)
|
||||
return proxy_cap_str(proxy->cap);
|
||||
}
|
||||
|
||||
/* this function initializes all timeouts for proxy p */
|
||||
static inline void proxy_reset_timeouts(struct proxy *proxy)
|
||||
{
|
||||
tv_eternity(&proxy->timeout.client);
|
||||
tv_eternity(&proxy->timeout.tarpit);
|
||||
tv_eternity(&proxy->timeout.queue);
|
||||
tv_eternity(&proxy->timeout.connect);
|
||||
tv_eternity(&proxy->timeout.server);
|
||||
tv_eternity(&proxy->timeout.appsession);
|
||||
tv_eternity(&proxy->timeout.httpreq);
|
||||
tv_eternity(&proxy->timeout.check);
|
||||
}
|
||||
|
||||
#endif /* _PROTO_PROXY_H */
|
||||
|
||||
/*
|
||||
|
@ -2,7 +2,7 @@
|
||||
include/types/proxy.h
|
||||
This file defines everything related to proxies.
|
||||
|
||||
Copyright (C) 2000-2007 Willy Tarreau - w@1wt.eu
|
||||
Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@ -170,7 +170,7 @@ struct proxy {
|
||||
char *monitor_uri; /* a special URI to which we respond with HTTP/200 OK */
|
||||
int monitor_uri_len; /* length of the string above. 0 if unused */
|
||||
struct list mon_fail_cond; /* list of conditions to fail monitoring requests (chained) */
|
||||
struct {
|
||||
struct { /* WARNING! check proxy_reset_timeouts() in proxy.h !!! */
|
||||
struct timeval client; /* client I/O timeout (in milliseconds) */
|
||||
struct timeval tarpit; /* tarpit timeout, defaults to connect if unspecified */
|
||||
struct timeval queue; /* queue timeout, defaults to connect if unspecified */
|
||||
|
@ -516,13 +516,7 @@ static void init_default_instance()
|
||||
defproxy.maxconn = cfg_maxpconn;
|
||||
defproxy.conn_retries = CONN_RETRIES;
|
||||
defproxy.logfac1 = defproxy.logfac2 = -1; /* log disabled */
|
||||
tv_eternity(&defproxy.timeout.client);
|
||||
tv_eternity(&defproxy.timeout.connect);
|
||||
tv_eternity(&defproxy.timeout.server);
|
||||
tv_eternity(&defproxy.timeout.appsession);
|
||||
tv_eternity(&defproxy.timeout.queue);
|
||||
tv_eternity(&defproxy.timeout.tarpit);
|
||||
tv_eternity(&defproxy.timeout.httpreq);
|
||||
proxy_reset_timeouts(&defproxy);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -599,13 +593,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
|
||||
/* Timeouts are defined as -1, so we cannot use the zeroed area
|
||||
* as a default value.
|
||||
*/
|
||||
tv_eternity(&curproxy->timeout.client);
|
||||
tv_eternity(&curproxy->timeout.server);
|
||||
tv_eternity(&curproxy->timeout.connect);
|
||||
tv_eternity(&curproxy->timeout.appsession);
|
||||
tv_eternity(&curproxy->timeout.queue);
|
||||
tv_eternity(&curproxy->timeout.tarpit);
|
||||
tv_eternity(&curproxy->timeout.httpreq);
|
||||
proxy_reset_timeouts(curproxy);
|
||||
|
||||
curproxy->last_change = now.tv_sec;
|
||||
curproxy->id = strdup(args[1]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user