|
@@ -316,8 +316,12 @@ int set_keepalive(int fd, int keepalive, int cnt, int idle, int intvl) {
|
|
|
res = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &idle, sizeof(idle));
|
|
|
assert(res == 0);
|
|
|
|
|
|
+#ifdef HAVE_TCP_KEEPIDLE
|
|
|
res = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(idle));
|
|
|
assert(res == 0);
|
|
|
+#else
|
|
|
+ LM_INFO("TCP_KEEPIDLE option not available - ignoring\n");
|
|
|
+#endif
|
|
|
|
|
|
res = setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &intvl, sizeof(intvl));
|
|
|
assert(res == 0);
|