Module: kamailio
Branch: master
Commit: 3da9060a4479b5d1275088213b560f9e3b250394
URL:
https://github.com/kamailio/kamailio/commit/3da9060a4479b5d1275088213b560f9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-04-22T13:17:01+02:00
janssonrpcc: do not set TCP_KEEPIDLE if not available in the OS
---
Modified: src/modules/janssonrpcc/janssonrpc_connect.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3da9060a4479b5d1275088213b560f9…
Patch:
https://github.com/kamailio/kamailio/commit/3da9060a4479b5d1275088213b560f9…
---
diff --git a/src/modules/janssonrpcc/janssonrpc_connect.c
b/src/modules/janssonrpcc/janssonrpc_connect.c
index b6f4d69912..6f5048efd4 100644
--- a/src/modules/janssonrpcc/janssonrpc_connect.c
+++ b/src/modules/janssonrpcc/janssonrpc_connect.c
@@ -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);