diff options
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r-- | src/microhttpd/daemon.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 9fc7ac0b..9843866d 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1145,7 +1145,7 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon, | |||
1145 | if ( (NULL == daemon) || | 1145 | if ( (NULL == daemon) || |
1146 | (NULL == read_fd_set) || | 1146 | (NULL == read_fd_set) || |
1147 | (NULL == write_fd_set) || | 1147 | (NULL == write_fd_set) || |
1148 | (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || | 1148 | MHD_D_IS_USING_THREADS_ (daemon) || |
1149 | MHD_D_IS_USING_POLL_ (daemon)) | 1149 | MHD_D_IS_USING_POLL_ (daemon)) |
1150 | return MHD_NO; | 1150 | return MHD_NO; |
1151 | 1151 | ||
@@ -1407,7 +1407,7 @@ process_urh (struct MHD_UpgradeResponseHandle *urh) | |||
1407 | bool was_closed; | 1407 | bool was_closed; |
1408 | 1408 | ||
1409 | #ifdef MHD_USE_THREADS | 1409 | #ifdef MHD_USE_THREADS |
1410 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 1410 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
1411 | MHD_thread_handle_ID_is_current_thread_ (connection->tid) ); | 1411 | MHD_thread_handle_ID_is_current_thread_ (connection->tid) ); |
1412 | #endif /* MHD_USE_THREADS */ | 1412 | #endif /* MHD_USE_THREADS */ |
1413 | if (daemon->shutdown) | 1413 | if (daemon->shutdown) |
@@ -1753,7 +1753,7 @@ thread_main_connection_upgrade (struct MHD_Connection *con) | |||
1753 | struct MHD_UpgradeResponseHandle *urh = con->urh; | 1753 | struct MHD_UpgradeResponseHandle *urh = con->urh; |
1754 | struct MHD_Daemon *daemon = con->daemon; | 1754 | struct MHD_Daemon *daemon = con->daemon; |
1755 | 1755 | ||
1756 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 1756 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
1757 | MHD_thread_handle_ID_is_current_thread_ (con->tid) ); | 1757 | MHD_thread_handle_ID_is_current_thread_ (con->tid) ); |
1758 | /* Here, we need to bi-directionally forward | 1758 | /* Here, we need to bi-directionally forward |
1759 | until the application tells us that it is done | 1759 | until the application tells us that it is done |
@@ -2830,7 +2830,7 @@ new_connection_process_ (struct MHD_Daemon *daemon, | |||
2830 | #ifdef MHD_USE_THREADS | 2830 | #ifdef MHD_USE_THREADS |
2831 | /* Function manipulate connection and timeout DL-lists, | 2831 | /* Function manipulate connection and timeout DL-lists, |
2832 | * must be called only within daemon thread. */ | 2832 | * must be called only within daemon thread. */ |
2833 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 2833 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
2834 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 2834 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
2835 | mhd_assert (NULL == daemon->worker_pool); | 2835 | mhd_assert (NULL == daemon->worker_pool); |
2836 | #endif /* MHD_USE_THREADS */ | 2836 | #endif /* MHD_USE_THREADS */ |
@@ -3101,7 +3101,7 @@ internal_add_connection (struct MHD_Daemon *daemon, | |||
3101 | return MHD_NO; | 3101 | return MHD_NO; |
3102 | 3102 | ||
3103 | if ((external_add) && | 3103 | if ((external_add) && |
3104 | (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))) | 3104 | MHD_D_IS_USING_THREADS_ (daemon)) |
3105 | { | 3105 | { |
3106 | /* Connection is added externally and MHD is handling its own threads. */ | 3106 | /* Connection is added externally and MHD is handling its own threads. */ |
3107 | MHD_mutex_lock_chk_ (&daemon->new_connections_mutex); | 3107 | MHD_mutex_lock_chk_ (&daemon->new_connections_mutex); |
@@ -3135,7 +3135,7 @@ new_connections_list_process_ (struct MHD_Daemon *daemon) | |||
3135 | struct MHD_Connection *local_head; | 3135 | struct MHD_Connection *local_head; |
3136 | struct MHD_Connection *local_tail; | 3136 | struct MHD_Connection *local_tail; |
3137 | mhd_assert (daemon->have_new); | 3137 | mhd_assert (daemon->have_new); |
3138 | mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)); | 3138 | mhd_assert (MHD_D_IS_USING_THREADS_ (daemon)); |
3139 | 3139 | ||
3140 | /* Detach DL-list of new connections from the daemon for | 3140 | /* Detach DL-list of new connections from the daemon for |
3141 | * following local processing. */ | 3141 | * following local processing. */ |
@@ -3188,7 +3188,7 @@ internal_suspend_connection_ (struct MHD_Connection *connection) | |||
3188 | mhd_assert (NULL == daemon->worker_pool); | 3188 | mhd_assert (NULL == daemon->worker_pool); |
3189 | 3189 | ||
3190 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 3190 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
3191 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 3191 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
3192 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \ | 3192 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \ |
3193 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 3193 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
3194 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); | 3194 | MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); |
@@ -3285,7 +3285,7 @@ MHD_suspend_connection (struct MHD_Connection *connection) | |||
3285 | struct MHD_Daemon *const daemon = connection->daemon; | 3285 | struct MHD_Daemon *const daemon = connection->daemon; |
3286 | 3286 | ||
3287 | #ifdef MHD_USE_THREADS | 3287 | #ifdef MHD_USE_THREADS |
3288 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 3288 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
3289 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \ | 3289 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \ |
3290 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 3290 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
3291 | #endif /* MHD_USE_THREADS */ | 3291 | #endif /* MHD_USE_THREADS */ |
@@ -3410,7 +3410,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
3410 | & MHD_USE_THREAD_PER_CONNECTION)); | 3410 | & MHD_USE_THREAD_PER_CONNECTION)); |
3411 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 3411 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
3412 | mhd_assert (NULL == daemon->worker_pool); | 3412 | mhd_assert (NULL == daemon->worker_pool); |
3413 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 3413 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
3414 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 3414 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
3415 | #endif | 3415 | #endif |
3416 | 3416 | ||
@@ -3571,12 +3571,12 @@ MHD_add_connection (struct MHD_Daemon *daemon, | |||
3571 | struct sockaddr_storage addrstorage; | 3571 | struct sockaddr_storage addrstorage; |
3572 | 3572 | ||
3573 | /* NOT thread safe with internal thread. TODO: fix thread safety. */ | 3573 | /* NOT thread safe with internal thread. TODO: fix thread safety. */ |
3574 | if ((0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) && | 3574 | if ((! MHD_D_IS_USING_THREADS_ (daemon)) && |
3575 | (daemon->connection_limit <= daemon->connections)) | 3575 | (daemon->connection_limit <= daemon->connections)) |
3576 | MHD_cleanup_connections (daemon); | 3576 | MHD_cleanup_connections (daemon); |
3577 | 3577 | ||
3578 | #ifdef HAVE_MESSAGES | 3578 | #ifdef HAVE_MESSAGES |
3579 | if ((0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) && | 3579 | if (MHD_D_IS_USING_THREADS_ (daemon) && |
3580 | (0 == (daemon->options & MHD_USE_ITC))) | 3580 | (0 == (daemon->options & MHD_USE_ITC))) |
3581 | { | 3581 | { |
3582 | MHD_DLOG (daemon, | 3582 | MHD_DLOG (daemon, |
@@ -3751,7 +3751,7 @@ MHD_accept_connection (struct MHD_Daemon *daemon) | |||
3751 | #endif /* ! USE_ACCEPT4 && ! _DEBUG */ | 3751 | #endif /* ! USE_ACCEPT4 && ! _DEBUG */ |
3752 | 3752 | ||
3753 | #ifdef MHD_USE_THREADS | 3753 | #ifdef MHD_USE_THREADS |
3754 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 3754 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
3755 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 3755 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
3756 | mhd_assert (NULL == daemon->worker_pool); | 3756 | mhd_assert (NULL == daemon->worker_pool); |
3757 | #endif /* MHD_USE_THREADS */ | 3757 | #endif /* MHD_USE_THREADS */ |
@@ -3975,7 +3975,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon) | |||
3975 | { | 3975 | { |
3976 | struct MHD_Connection *pos; | 3976 | struct MHD_Connection *pos; |
3977 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 3977 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
3978 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 3978 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
3979 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 3979 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
3980 | mhd_assert (NULL == daemon->worker_pool); | 3980 | mhd_assert (NULL == daemon->worker_pool); |
3981 | 3981 | ||
@@ -4162,7 +4162,7 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, | |||
4162 | struct MHD_Connection *earliest_tmot_conn; /**< the connection with earliest timeout */ | 4162 | struct MHD_Connection *earliest_tmot_conn; /**< the connection with earliest timeout */ |
4163 | 4163 | ||
4164 | #ifdef MHD_USE_THREADS | 4164 | #ifdef MHD_USE_THREADS |
4165 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 4165 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
4166 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 4166 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
4167 | #endif /* MHD_USE_THREADS */ | 4167 | #endif /* MHD_USE_THREADS */ |
4168 | 4168 | ||
@@ -4579,7 +4579,7 @@ MHD_run_from_select2 (struct MHD_Daemon *daemon, | |||
4579 | unsigned int fd_setsize) | 4579 | unsigned int fd_setsize) |
4580 | { | 4580 | { |
4581 | if (MHD_D_IS_USING_POLL_ (daemon) || | 4581 | if (MHD_D_IS_USING_POLL_ (daemon) || |
4582 | (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))) | 4582 | MHD_D_IS_USING_THREADS_ (daemon)) |
4583 | return MHD_NO; | 4583 | return MHD_NO; |
4584 | if ((NULL == read_fd_set) || (NULL == write_fd_set)) | 4584 | if ((NULL == read_fd_set) || (NULL == write_fd_set)) |
4585 | return MHD_NO; | 4585 | return MHD_NO; |
@@ -5313,7 +5313,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon) | |||
5313 | struct MHD_UpgradeResponseHandle *prev; | 5313 | struct MHD_UpgradeResponseHandle *prev; |
5314 | 5314 | ||
5315 | #ifdef MHD_USE_THREADS | 5315 | #ifdef MHD_USE_THREADS |
5316 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 5316 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
5317 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 5317 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
5318 | #endif /* MHD_USE_THREADS */ | 5318 | #endif /* MHD_USE_THREADS */ |
5319 | 5319 | ||
@@ -5765,7 +5765,7 @@ _MHD_EXTERN enum MHD_Result | |||
5765 | MHD_run (struct MHD_Daemon *daemon) | 5765 | MHD_run (struct MHD_Daemon *daemon) |
5766 | { | 5766 | { |
5767 | if ( (daemon->shutdown) || | 5767 | if ( (daemon->shutdown) || |
5768 | (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) ) | 5768 | MHD_D_IS_USING_THREADS_ (daemon) ) |
5769 | return MHD_NO; | 5769 | return MHD_NO; |
5770 | 5770 | ||
5771 | (void) MHD_run_wait (daemon, 0); | 5771 | (void) MHD_run_wait (daemon, 0); |
@@ -5817,7 +5817,7 @@ MHD_run_wait (struct MHD_Daemon *daemon, | |||
5817 | { | 5817 | { |
5818 | enum MHD_Result res; | 5818 | enum MHD_Result res; |
5819 | if ( (daemon->shutdown) || | 5819 | if ( (daemon->shutdown) || |
5820 | (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) ) | 5820 | MHD_D_IS_USING_THREADS_ (daemon) ) |
5821 | return MHD_NO; | 5821 | return MHD_NO; |
5822 | 5822 | ||
5823 | mhd_assert (! MHD_thread_handle_ID_is_valid_handle_ (daemon->tid)); | 5823 | mhd_assert (! MHD_thread_handle_ID_is_valid_handle_ (daemon->tid)); |
@@ -5881,7 +5881,7 @@ close_connection (struct MHD_Connection *pos) | |||
5881 | struct MHD_Daemon *daemon = pos->daemon; | 5881 | struct MHD_Daemon *daemon = pos->daemon; |
5882 | 5882 | ||
5883 | #ifdef MHD_USE_THREADS | 5883 | #ifdef MHD_USE_THREADS |
5884 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 5884 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
5885 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 5885 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
5886 | mhd_assert (NULL == daemon->worker_pool); | 5886 | mhd_assert (NULL == daemon->worker_pool); |
5887 | #endif /* MHD_USE_THREADS */ | 5887 | #endif /* MHD_USE_THREADS */ |
@@ -6097,7 +6097,7 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon) | |||
6097 | if (MHD_INVALID_SOCKET == ret) | 6097 | if (MHD_INVALID_SOCKET == ret) |
6098 | return MHD_INVALID_SOCKET; | 6098 | return MHD_INVALID_SOCKET; |
6099 | if ( (0 == (daemon->options & (MHD_USE_ITC))) && | 6099 | if ( (0 == (daemon->options & (MHD_USE_ITC))) && |
6100 | (0 != (daemon->options & (MHD_USE_INTERNAL_POLLING_THREAD))) ) | 6100 | MHD_D_IS_USING_THREADS_ (daemon) ) |
6101 | { | 6101 | { |
6102 | #ifdef HAVE_MESSAGES | 6102 | #ifdef HAVE_MESSAGES |
6103 | MHD_DLOG (daemon, | 6103 | MHD_DLOG (daemon, |
@@ -6662,7 +6662,7 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
6662 | #endif /* SIZEOF_UNSIGNED_INT >= (SIZEOF_SIZE_T - 2) */ | 6662 | #endif /* SIZEOF_UNSIGNED_INT >= (SIZEOF_SIZE_T - 2) */ |
6663 | else | 6663 | else |
6664 | { | 6664 | { |
6665 | if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) | 6665 | if (! MHD_D_IS_USING_THREADS_ (daemon)) |
6666 | { | 6666 | { |
6667 | #ifdef HAVE_MESSAGES | 6667 | #ifdef HAVE_MESSAGES |
6668 | MHD_DLOG (daemon, | 6668 | MHD_DLOG (daemon, |
@@ -7167,7 +7167,7 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
7167 | #endif | 7167 | #endif |
7168 | #endif /* HTTPS_SUPPORT */ | 7168 | #endif /* HTTPS_SUPPORT */ |
7169 | case MHD_OPTION_SIGPIPE_HANDLED_BY_APP: | 7169 | case MHD_OPTION_SIGPIPE_HANDLED_BY_APP: |
7170 | if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) | 7170 | if (! MHD_D_IS_USING_THREADS_ (daemon)) |
7171 | daemon->sigpipe_blocked = ( (va_arg (ap, | 7171 | daemon->sigpipe_blocked = ( (va_arg (ap, |
7172 | int)) != 0); | 7172 | int)) != 0); |
7173 | else | 7173 | else |
@@ -7284,7 +7284,7 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon) | |||
7284 | 7284 | ||
7285 | mhd_assert (MHD_D_IS_USING_EPOLL_ (daemon)); | 7285 | mhd_assert (MHD_D_IS_USING_EPOLL_ (daemon)); |
7286 | mhd_assert (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)); | 7286 | mhd_assert (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)); |
7287 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 7287 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
7288 | (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) || \ | 7288 | (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) || \ |
7289 | MHD_ITC_IS_VALID_ (daemon->itc) ); | 7289 | MHD_ITC_IS_VALID_ (daemon->itc) ); |
7290 | daemon->epoll_fd = setup_epoll_fd (daemon); | 7290 | daemon->epoll_fd = setup_epoll_fd (daemon); |
@@ -7792,7 +7792,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
7792 | 7792 | ||
7793 | /* Thread polling currently works only with internal select thread mode */ | 7793 | /* Thread polling currently works only with internal select thread mode */ |
7794 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 7794 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
7795 | if ( (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) && | 7795 | if ( (! MHD_D_IS_USING_THREADS_ (daemon)) && |
7796 | (daemon->worker_pool_size > 0) ) | 7796 | (daemon->worker_pool_size > 0) ) |
7797 | { | 7797 | { |
7798 | #ifdef HAVE_MESSAGES | 7798 | #ifdef HAVE_MESSAGES |
@@ -8231,7 +8231,7 @@ MHD_start_daemon_va (unsigned int flags, | |||
8231 | #endif /* HTTPS_SUPPORT */ | 8231 | #endif /* HTTPS_SUPPORT */ |
8232 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 8232 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
8233 | /* Start threads if requested by parameters */ | 8233 | /* Start threads if requested by parameters */ |
8234 | if (0 != (*pflags & MHD_USE_INTERNAL_POLLING_THREAD)) | 8234 | if (MHD_D_IS_USING_THREADS_ (daemon)) |
8235 | { | 8235 | { |
8236 | /* Internal thread (or threads) is used. | 8236 | /* Internal thread (or threads) is used. |
8237 | * Make sure that MHD will be able to communicate with threads. */ | 8237 | * Make sure that MHD will be able to communicate with threads. */ |
@@ -8581,7 +8581,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
8581 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ | 8581 | #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */ |
8582 | 8582 | ||
8583 | #ifdef MHD_USE_THREADS | 8583 | #ifdef MHD_USE_THREADS |
8584 | mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \ | 8584 | mhd_assert ( (! MHD_D_IS_USING_THREADS_ (daemon)) || \ |
8585 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \ | 8585 | (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \ |
8586 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); | 8586 | MHD_thread_handle_ID_is_current_thread_ (daemon->tid) ); |
8587 | mhd_assert (NULL == daemon->worker_pool); | 8587 | mhd_assert (NULL == daemon->worker_pool); |
@@ -8593,7 +8593,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
8593 | * not processed by the daemon thread. */ | 8593 | * not processed by the daemon thread. */ |
8594 | while (NULL != (pos = daemon->new_connections_tail)) | 8594 | while (NULL != (pos = daemon->new_connections_tail)) |
8595 | { | 8595 | { |
8596 | mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)); | 8596 | mhd_assert (MHD_D_IS_USING_THREADS_ (daemon)); |
8597 | DLL_remove (daemon->new_connections_head, | 8597 | DLL_remove (daemon->new_connections_head, |
8598 | daemon->new_connections_tail, | 8598 | daemon->new_connections_tail, |
8599 | pos); | 8599 | pos); |
@@ -8809,7 +8809,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
8809 | if (NULL != daemon->worker_pool) | 8809 | if (NULL != daemon->worker_pool) |
8810 | { /* Master daemon with worker pool. */ | 8810 | { /* Master daemon with worker pool. */ |
8811 | mhd_assert (1 < daemon->worker_pool_size); | 8811 | mhd_assert (1 < daemon->worker_pool_size); |
8812 | mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)); | 8812 | mhd_assert (MHD_D_IS_USING_THREADS_ (daemon)); |
8813 | 8813 | ||
8814 | /* Let workers shutdown in parallel. */ | 8814 | /* Let workers shutdown in parallel. */ |
8815 | for (i = 0; i < daemon->worker_pool_size; ++i) | 8815 | for (i = 0; i < daemon->worker_pool_size; ++i) |
@@ -8849,7 +8849,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) | |||
8849 | #endif | 8849 | #endif |
8850 | { /* Worker daemon or single daemon. */ | 8850 | { /* Worker daemon or single daemon. */ |
8851 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 8851 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
8852 | if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) | 8852 | if (MHD_D_IS_USING_THREADS_ (daemon)) |
8853 | { /* Worker daemon or single daemon with internal thread(s). */ | 8853 | { /* Worker daemon or single daemon with internal thread(s). */ |
8854 | mhd_assert (0 == daemon->worker_pool_size); | 8854 | mhd_assert (0 == daemon->worker_pool_size); |
8855 | /* Separate thread(s) is used for polling sockets. */ | 8855 | /* Separate thread(s) is used for polling sockets. */ |
@@ -8997,7 +8997,7 @@ MHD_get_daemon_info (struct MHD_Daemon *daemon, | |||
8997 | return NULL; | 8997 | return NULL; |
8998 | #endif /* ! EPOLL_SUPPORT */ | 8998 | #endif /* ! EPOLL_SUPPORT */ |
8999 | case MHD_DAEMON_INFO_CURRENT_CONNECTIONS: | 8999 | case MHD_DAEMON_INFO_CURRENT_CONNECTIONS: |
9000 | if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) | 9000 | if (! MHD_D_IS_USING_THREADS_ (daemon)) |
9001 | { | 9001 | { |
9002 | /* Assume that MHD_run() in not called in other thread | 9002 | /* Assume that MHD_run() in not called in other thread |
9003 | * at the same time. */ | 9003 | * at the same time. */ |