]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Make the keepalive stuff compile under macOS.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 30 Nov 2022 17:01:06 +0000 (17:01 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Wed, 30 Nov 2022 17:01:06 +0000 (17:01 +0000)
rtsp.c

diff --git a/rtsp.c b/rtsp.c
index c105ec0aff6951369acf3b6c54b0af6b8d1cb39c..57d91061bf91750d6f81ae848f6f3f57d12d92e6 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -5505,12 +5505,20 @@ void *rtsp_listen_loop(__attribute((unused)) void *arg) {
           int keepAliveCount = 5; // check this many times
           int keepAliveInterval = 5; // wait this many seconds between checks
           
+
 #if defined COMPILE_FOR_BSD || defined COMPILE_FOR_OSX
           #define SOL_OPTION IPPROTO_TCP
 #else
           #define SOL_OPTION SOL_TCP
 #endif
 
+#ifdef COMPILE_FOR_OSX
+          #define KEEP_ALIVE_OR_IDLE_OPTION TCP_KEEPALIVE
+#else
+          #define KEEP_ALIVE_OR_IDLE_OPTION TCP_KEEPIDLE
+#endif
+          
+
           if (setsockopt(conn->fd, SOL_OPTION, TCP_KEEPIDLE, (void *)&keepAliveIdleTime, sizeof(keepAliveIdleTime))) {
             debug(1,"can't set the keepidle wait time");
           }