aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 231ac57f..c0278246 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3550,7 +3550,11 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
3550 s = accept (fd, 3550 s = accept (fd,
3551 addr, 3551 addr,
3552 &addrlen); 3552 &addrlen);
3553#ifdef MHD_ACCEPT_INHERIT_NONBLOCK
3554 sk_nonbl = daemon->listen_nonblk;
3555#else /* ! MHD_ACCEPT_INHERIT_NONBLOCK */
3553 sk_nonbl = false; 3556 sk_nonbl = false;
3557#endif /* ! MHD_ACCEPT_INHERIT_NONBLOCK */
3554#ifndef MHD_WINSOCK_SOCKETS 3558#ifndef MHD_WINSOCK_SOCKETS
3555 sk_spipe_supprs = false; 3559 sk_spipe_supprs = false;
3556#else /* MHD_WINSOCK_SOCKETS */ 3560#else /* MHD_WINSOCK_SOCKETS */
@@ -3615,15 +3619,17 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
3615 } 3619 }
3616 return MHD_NO; 3620 return MHD_NO;
3617 } 3621 }
3618#if ! defined(USE_ACCEPT4) || ! defined(HAVE_SOCK_NONBLOCK) 3622
3619 if (! MHD_socket_nonblocking_ (s)) 3623 if (! sk_nonbl && ! MHD_socket_nonblocking_ (s))
3620 { 3624 {
3621#ifdef HAVE_MESSAGES 3625#ifdef HAVE_MESSAGES
3622 MHD_DLOG (daemon, 3626 MHD_DLOG (daemon,
3623 _ ("Failed to set nonblocking mode on incoming connection " \ 3627 _ ("Failed to set nonblocking mode on incoming connection " \
3624 "socket: %s\n"), 3628 "socket: %s\n"),
3625 MHD_socket_last_strerr_ ()); 3629 MHD_socket_last_strerr_ ());
3626#endif 3630#else /* ! HAVE_MESSAGES */
3631 (void) 0; /* Mute compiler warning */
3632#endif /* ! HAVE_MESSAGES */
3627 } 3633 }
3628 else 3634 else
3629 sk_nonbl = true; 3635 sk_nonbl = true;