Fix TCP keepalives on OS X 10.9
authorJack Nagel <jacknagel@gmail.com>
Thu, 07 Nov 2013 02:09:16 -0600
changeset 652 c20a83e11260
parent 651 2990ee03cfa3
child 653 49b6d6bc7321
Fix TCP keepalives on OS X 10.9 Mac OS X 10.9 defines TCP_KEEPCNT, which triggers USE_TCP_KEEPALIVES. However, it defines TCP_KEEPALIVE rather than TCP_KEEPIDLE.
loudmouth/lm-sock.c
--- a/loudmouth/lm-sock.c	Mon Nov 04 21:30:28 2013 +0100
+++ b/loudmouth/lm-sock.c	Thu Nov 07 02:09:16 2013 -0600
@@ -314,6 +314,13 @@
 _lm_sock_set_keepalive (LmOldSocketT sock, int delay)
 {
 #ifdef USE_TCP_KEEPALIVES
+
+#ifdef __APPLE__
+#ifndef TCP_KEEPIDLE
+#define TCP_KEEPIDLE TCP_KEEPALIVE
+#endif
+#endif
+
     int opt;
 
     opt = 1;