From: David Goulet Date: Tue, 27 Aug 2013 20:04:36 +0000 (-0400) Subject: Use socket timeout value for tcp timeout if available X-Git-Tag: v2.3.0-rc3~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=18eed43f43cded76d81baa60d1687d13c1953e82;p=lttng-tools.git Use socket timeout value for tcp timeout if available Make the inet subsystem initialize the tcp timeout value with the env. variable LTTNG_NETWORK_SOCKET_TIMEOUT if available. Signed-off-by: David Goulet --- diff --git a/src/common/sessiond-comm/inet.c b/src/common/sessiond-comm/inet.c index b5a016e6f..fa9218769 100644 --- a/src/common/sessiond-comm/inet.c +++ b/src/common/sessiond-comm/inet.c @@ -495,7 +495,13 @@ error: LTTNG_HIDDEN void lttcomm_inet_init(void) { - unsigned long syn_retries, fin_timeout, syn_timeout; + unsigned long syn_retries, fin_timeout, syn_timeout, env; + + env = lttcomm_get_network_timeout(); + if (env) { + lttcomm_inet_tcp_timeout = env; + goto end; + } /* Assign default value and see if we can change it. */ lttcomm_inet_tcp_timeout = DEFAULT_INET_TCP_TIMEOUT; @@ -513,5 +519,6 @@ void lttcomm_inet_init(void) max_t(unsigned long, syn_timeout, fin_timeout), lttcomm_inet_tcp_timeout); +end: DBG("TCP inet operation timeout set to %lu sec", lttcomm_inet_tcp_timeout); }