From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 30 Nov 2022 17:01:06 +0000 (+0000) Subject: Make the keepalive stuff compile under macOS. X-Git-Tag: 4.1.1~2^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf5fefb558e50f496481616603862cb126af37b;p=thirdparty%2Fshairport-sync.git Make the keepalive stuff compile under macOS. --- diff --git a/rtsp.c b/rtsp.c index c105ec0a..57d91061 100644 --- 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"); }