aboutsummaryrefslogtreecommitdiff
path: root/src/lib/daemon_start.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/daemon_start.c')
-rw-r--r--src/lib/daemon_start.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/daemon_start.c b/src/lib/daemon_start.c
index 2596b725..2d44fe51 100644
--- a/src/lib/daemon_start.c
+++ b/src/lib/daemon_start.c
@@ -669,20 +669,20 @@ setup_thread_pool (struct MHD_Daemon *daemon)
669 * due to integer division). Also keep track of how many 669 * due to integer division). Also keep track of how many
670 * connections are leftover after an equal split. */ 670 * connections are leftover after an equal split. */
671 unsigned int conns_per_thread = daemon->global_connection_limit 671 unsigned int conns_per_thread = daemon->global_connection_limit
672 / daemon->threading_model; 672 / daemon->threading_mode;
673 unsigned int leftover_conns = daemon->global_connection_limit 673 unsigned int leftover_conns = daemon->global_connection_limit
674 % daemon->threading_model; 674 % daemon->threading_mode;
675 int i; 675 int i;
676 enum MHD_StatusCode sc; 676 enum MHD_StatusCode sc;
677 677
678 /* Allocate memory for pooled objects */ 678 /* Allocate memory for pooled objects */
679 daemon->worker_pool = MHD_calloc_ (daemon->threading_model, 679 daemon->worker_pool = MHD_calloc_ (daemon->threading_mode,
680 sizeof (struct MHD_Daemon)); 680 sizeof (struct MHD_Daemon));
681 if (NULL == daemon->worker_pool) 681 if (NULL == daemon->worker_pool)
682 return MHD_SC_THREAD_POOL_MALLOC_FAILURE; 682 return MHD_SC_THREAD_POOL_MALLOC_FAILURE;
683 683
684 /* Start the workers in the pool */ 684 /* Start the workers in the pool */
685 for (i = 0; i < daemon->threading_model; i++) 685 for (i = 0; i < daemon->threading_mode; i++)
686 { 686 {
687 /* Create copy of the Daemon object for each worker */ 687 /* Create copy of the Daemon object for each worker */
688 struct MHD_Daemon *d = &daemon->worker_pool[i]; 688 struct MHD_Daemon *d = &daemon->worker_pool[i];
@@ -691,7 +691,7 @@ setup_thread_pool (struct MHD_Daemon *daemon)
691 daemon, 691 daemon,
692 sizeof (struct MHD_Daemon)); 692 sizeof (struct MHD_Daemon));
693 /* Adjust pooling params for worker daemons; note that memcpy() 693 /* Adjust pooling params for worker daemons; note that memcpy()
694 has already copied MHD_USE_INTERNAL_POLLING_THREAD thread model into 694 has already copied MHD_USE_INTERNAL_POLLING_THREAD thread mode into
695 the worker threads. */ 695 the worker threads. */
696 d->master = daemon; 696 d->master = daemon;
697 d->worker_pool_size = 0; 697 d->worker_pool_size = 0;
@@ -822,7 +822,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
822 /* We do not support thread-per-connection in combination 822 /* We do not support thread-per-connection in combination
823 with epoll, so use poll in this case, otherwise prefer 823 with epoll, so use poll in this case, otherwise prefer
824 epoll. */ 824 epoll. */
825 if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_model) 825 if (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
826 daemon->event_loop_syscall = MHD_ELS_POLL; 826 daemon->event_loop_syscall = MHD_ELS_POLL;
827 else 827 else
828 daemon->event_loop_syscall = MHD_ELS_EPOLL; 828 daemon->event_loop_syscall = MHD_ELS_EPOLL;
@@ -837,7 +837,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
837 if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) && 837 if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
838 (0 == daemon->worker_pool_size) && 838 (0 == daemon->worker_pool_size) &&
839 (MHD_INVALID_SOCKET != daemon->listen_socket) && 839 (MHD_INVALID_SOCKET != daemon->listen_socket) &&
840 (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_model) ) 840 (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) )
841 { 841 {
842#ifdef HAVE_MESSAGES 842#ifdef HAVE_MESSAGES
843 MHD_DLOG (daemon, 843 MHD_DLOG (daemon,
@@ -927,11 +927,11 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
927 /* Setup main listen thread (only if we have no thread pool or 927 /* Setup main listen thread (only if we have no thread pool or
928 external event loop and do have a listen socket) */ 928 external event loop and do have a listen socket) */
929 /* FIXME: why no worker thread if we have no listen socket? */ 929 /* FIXME: why no worker thread if we have no listen socket? */
930 if ( ( (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_model) || 930 if ( ( (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode) ||
931 (1 == daemon->threading_model) ) && 931 (1 == daemon->threading_mode) ) &&
932 (MHD_INVALID_SOCKET != daemon->listen_socket) && 932 (MHD_INVALID_SOCKET != daemon->listen_socket) &&
933 (! MHD_create_named_thread_ (&daemon->pid, 933 (! MHD_create_named_thread_ (&daemon->pid,
934 (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_model) 934 (MHD_TM_THREAD_PER_CONNECTION == daemon->threading_mode)
935 ? "MHD-listen" 935 ? "MHD-listen"
936 : "MHD-single", 936 : "MHD-single",
937 daemon->thread_stack_limit_b, 937 daemon->thread_stack_limit_b,
@@ -949,7 +949,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
949 949
950 /* Setup worker threads */ 950 /* Setup worker threads */
951 /* FIXME: why no thread pool if we have no listen socket? */ 951 /* FIXME: why no thread pool if we have no listen socket? */
952 if ( (1 < daemon->threading_model) && 952 if ( (1 < daemon->threading_mode) &&
953 (MHD_INVALID_SOCKET != daemon->listen_socket) && 953 (MHD_INVALID_SOCKET != daemon->listen_socket) &&
954 (MHD_SC_OK != (sc = setup_thread_pool (daemon))) ) 954 (MHD_SC_OK != (sc = setup_thread_pool (daemon))) )
955 return sc; 955 return sc;