summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-04-14 10:24:58 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-04-14 10:24:58 +0000
commit3b16774228a918848596a7ce6b1ac46e3288636d (patch)
tree50adcc089dc1998c3aafe77aae4575d1ac009790
parent699c31e686ca3e1ecea93252d589f9a0e56c6a54 (diff)
Corrected pipes for worker thread for modes without MHD_USE_SUSPEND_RESUME
-rw-r--r--src/microhttpd/daemon.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index fcbf445a..f93fea2e 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4290,27 +4290,28 @@ MHD_start_daemon_va (unsigned int flags,
d->worker_pool_size = 0;
d->worker_pool = NULL;
- if ( (MHD_USE_SUSPEND_RESUME == (flags & MHD_USE_SUSPEND_RESUME)) &&
- (0 != MHD_pipe_ (d->wpipe)) )
+ if (MHD_USE_SUSPEND_RESUME == (flags & MHD_USE_SUSPEND_RESUME))
{
+ if (0 != MHD_pipe_ (d->wpipe))
+ {
#ifdef HAVE_MESSAGES
- MHD_DLOG (daemon,
- "Failed to create worker control pipe: %s\n",
- MHD_pipe_last_strerror_() );
+ MHD_DLOG (daemon,
+ "Failed to create worker control pipe: %s\n",
+ MHD_pipe_last_strerror_() );
#endif
- goto thread_failed;
- }
- if (MHD_NO == make_nonblocking (d, d->wpipe[0]))
- {
+ goto thread_failed;
+ }
+ if (MHD_NO == make_nonblocking (d, d->wpipe[0]))
+ {
#ifdef HAVE_MESSAGES
- MHD_DLOG (daemon,
- "Failed to make worker control pipe non_blocking: %s\n",
- MHD_pipe_last_strerror_() );
+ MHD_DLOG (daemon,
+ "Failed to make worker control pipe non_blocking: %s\n",
+ MHD_pipe_last_strerror_() );
#endif
-
- goto thread_failed;
+ goto thread_failed;
+ }
+ make_nonblocking (d, d->wpipe[1]);
}
- make_nonblocking (d, d->wpipe[1]);
#ifndef MHD_WINSOCK_SOCKETS
if ( (0 == (flags & (MHD_USE_POLL | MHD_USE_EPOLL_LINUX_ONLY))) &&
(MHD_USE_SUSPEND_RESUME == (flags & MHD_USE_SUSPEND_RESUME)) &&