diff options
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r-- | src/daemon/daemon.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index d35be3a6..326a13b8 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -254,6 +254,9 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
254 | struct sockaddr *addr = (struct sockaddr *) &addr6; | 254 | struct sockaddr *addr = (struct sockaddr *) &addr6; |
255 | socklen_t addrlen; | 255 | socklen_t addrlen; |
256 | int s; | 256 | int s; |
257 | #if OSX | ||
258 | static int on=1; | ||
259 | #endif | ||
257 | 260 | ||
258 | 261 | ||
259 | if (sizeof (struct sockaddr) > sizeof (struct sockaddr_in6)) | 262 | if (sizeof (struct sockaddr) > sizeof (struct sockaddr_in6)) |
@@ -296,6 +299,17 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
296 | CLOSE (s); | 299 | CLOSE (s); |
297 | return MHD_YES; | 300 | return MHD_YES; |
298 | } | 301 | } |
302 | #if OSX | ||
303 | #ifdef SOL_SOCKET | ||
304 | #ifdef SO_NOSIGPIPE | ||
305 | setsockopt(s, | ||
306 | SOL_SOCKET, | ||
307 | SO_NOSIGPIPE, | ||
308 | &on, | ||
309 | sizeof(on)); | ||
310 | #endif | ||
311 | #endif | ||
312 | #endif | ||
299 | connection = malloc (sizeof (struct MHD_Connection)); | 313 | connection = malloc (sizeof (struct MHD_Connection)); |
300 | if (connection == NULL) | 314 | if (connection == NULL) |
301 | { | 315 | { |