commit 6f6a4e220b2a02b86364cfe093570ad4ddd06860
parent 7b0d92902c92782844e84e40ab54d58a65531a65
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 26 Mar 2017 13:32:12 +0300
MHD_start_daemon(): obey MHD_USE_ITC in thread pool mode
Diffstat:
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Mar 26 13:49:01 MSK 2017
+ Internal refactoring for simplification and unification.
+ Minor optimizations and minor fixes.
+ MHD_USE_ITC used again in thread pool mode. -EG
+
Sat Mar 25 20:58:24 CET 2017
Remove dead MHD_strx_to_sizet-functions and associated
test cases from code. -CG
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -5955,8 +5955,7 @@ MHD_start_daemon_va (unsigned int flags,
d->worker_pool_size = 0;
d->worker_pool = NULL;
- /* Always use individual control ITCs */
- if (1)
+ if (0 != (*pflags & MHD_USE_ITC))
{
if (! MHD_itc_init_ (d->itc))
{
@@ -5967,17 +5966,17 @@ MHD_start_daemon_va (unsigned int flags,
#endif
goto thread_failed;
}
- }
- if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
- (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (d->itc),
- NULL)) )
- {
+ if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
+ (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (d->itc),
+ NULL)) )
+ {
#ifdef HAVE_MESSAGES
- MHD_DLOG (daemon,
- _("File descriptor for worker inter-thread communication channel exceeds maximum value\n"));
+ MHD_DLOG (daemon,
+ _("File descriptor for worker inter-thread communication channel exceeds maximum value\n"));
#endif
- MHD_itc_destroy_chk_ (d->itc);
- goto thread_failed;
+ MHD_itc_destroy_chk_ (d->itc);
+ goto thread_failed;
+ }
}
/* Divide available connections evenly amongst the threads.