diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index f36394da87..69ff5167a3 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed Nov 27 10:20:13 CST 2013 +Fri Jan 17 06:55:06 UTC 2014 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c index 7196955e27..70cf64385b 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_tcp.c @@ -196,12 +196,14 @@ int tport_tcp_init_secondary(tport_t *self, int socket, int accepted, #if defined(SO_KEEPALIVE) setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, (void *)&val, sizeof val); #endif - val = 30; + val = (int)(self->tp_params->tpp_keepalive); #if defined(TCP_KEEPIDLE) - setsockopt(socket, SOL_TCP, TCP_KEEPIDLE, (void *)&val, sizeof val); + if (val != 0 && val != UINT_MAX) + setsockopt(socket, SOL_TCP, TCP_KEEPIDLE, (void *)&val, sizeof val); #endif #if defined(TCP_KEEPINTVL) - setsockopt(socket, SOL_TCP, TCP_KEEPINTVL, (void *)&val, sizeof val); + if (val != 0 && val != UINT_MAX) + setsockopt(socket, SOL_TCP, TCP_KEEPINTVL, (void *)&val, sizeof val); #endif if (!accepted)