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.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 89771188..a868c764 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5313,7 +5313,6 @@ MHD_start_daemon_va (unsigned int flags,
5313 const struct sockaddr *servaddr = NULL; 5313 const struct sockaddr *servaddr = NULL;
5314 socklen_t addrlen; 5314 socklen_t addrlen;
5315 unsigned int i; 5315 unsigned int i;
5316 int use_itc;
5317 enum MHD_FLAG eflags; /* same type as in MHD_Daemon */ 5316 enum MHD_FLAG eflags; /* same type as in MHD_Daemon */
5318 enum MHD_FLAG *pflags; 5317 enum MHD_FLAG *pflags;
5319 5318
@@ -5443,14 +5442,16 @@ MHD_start_daemon_va (unsigned int flags,
5443#endif 5442#endif
5444 *pflags |= MHD_USE_INTERNAL_POLLING_THREAD; 5443 *pflags |= MHD_USE_INTERNAL_POLLING_THREAD;
5445 } 5444 }
5445 if (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD))
5446 *pflags &= ~MHD_USE_ITC; /* useless if we are using 'external' select */
5447 else
5448 {
5446#ifdef HAVE_LISTEN_SHUTDOWN 5449#ifdef HAVE_LISTEN_SHUTDOWN
5447 use_itc = (0 != (*pflags & (MHD_USE_NO_LISTEN_SOCKET | MHD_USE_ITC))); 5450 if (0 != (*pflags & MHD_USE_NO_LISTEN_SOCKET))
5448#else
5449 use_itc = 1; /* yes, must use ITC to signal thread */
5450#endif 5451#endif
5451 if (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) 5452 *pflags |= MHD_USE_ITC; /* yes, must use ITC to signal thread */
5452 use_itc = 0; /* useless if we are using 'external' select */ 5453 }
5453 if (use_itc) 5454 if (0 != (*pflags & MHD_USE_ITC))
5454 { 5455 {
5455 if (! MHD_itc_init_ (daemon->itc)) 5456 if (! MHD_itc_init_ (daemon->itc))
5456 { 5457 {
@@ -5462,20 +5463,19 @@ MHD_start_daemon_va (unsigned int flags,
5462 free (daemon); 5463 free (daemon);
5463 return NULL; 5464 return NULL;
5464 } 5465 }
5465 } 5466 if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
5466 if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) && 5467 (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
5467 (1 == use_itc) && 5468 NULL)) )
5468 (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc), 5469 {
5469 NULL)) )
5470 {
5471#ifdef HAVE_MESSAGES 5470#ifdef HAVE_MESSAGES
5472 MHD_DLOG (daemon, 5471 MHD_DLOG (daemon,
5473 _("file descriptor for inter-thread communication channel exceeds maximum value\n")); 5472 _("file descriptor for inter-thread communication channel exceeds maximum value\n"));
5474#endif 5473#endif
5475 MHD_itc_destroy_chk_ (daemon->itc); 5474 MHD_itc_destroy_chk_ (daemon->itc);
5476 free (daemon); 5475 free (daemon);
5477 return NULL; 5476 return NULL;
5478 } 5477 }
5478 }
5479#ifdef DAUTH_SUPPORT 5479#ifdef DAUTH_SUPPORT
5480 daemon->digest_auth_rand_size = 0; 5480 daemon->digest_auth_rand_size = 0;
5481 daemon->digest_auth_random = NULL; 5481 daemon->digest_auth_random = NULL;