aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 2d9dd9a9..7fd52739 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -687,6 +687,9 @@ MHD_connection_close_ (struct MHD_Connection *connection,
687 struct MHD_Daemon *daemon = connection->daemon; 687 struct MHD_Daemon *daemon = connection->daemon;
688 struct MHD_Response *resp = connection->response; 688 struct MHD_Response *resp = connection->response;
689 689
690 mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
691 MHD_thread_ID_match_current_ (connection->pid) );
692
690 MHD_connection_mark_closed_ (connection); 693 MHD_connection_mark_closed_ (connection);
691 if (NULL != resp) 694 if (NULL != resp)
692 { 695 {
@@ -720,6 +723,10 @@ MHD_connection_finish_forward_ (struct MHD_Connection *connection)
720 struct MHD_Daemon *daemon = connection->daemon; 723 struct MHD_Daemon *daemon = connection->daemon;
721 struct MHD_UpgradeResponseHandle *urh = connection->urh; 724 struct MHD_UpgradeResponseHandle *urh = connection->urh;
722 725
726 mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
727 (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) || \
728 MHD_thread_ID_match_current_ (daemon->pid) );
729
723 if (0 == (daemon->options & MHD_USE_TLS)) 730 if (0 == (daemon->options & MHD_USE_TLS))
724 return; /* Nothing to do with non-TLS connection. */ 731 return; /* Nothing to do with non-TLS connection. */
725 732
@@ -3158,6 +3165,8 @@ static void
3158cleanup_connection (struct MHD_Connection *connection) 3165cleanup_connection (struct MHD_Connection *connection)
3159{ 3166{
3160 struct MHD_Daemon *daemon = connection->daemon; 3167 struct MHD_Daemon *daemon = connection->daemon;
3168 mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
3169 MHD_thread_ID_match_current_ (connection->pid) );
3161 3170
3162 if (connection->in_cleanup) 3171 if (connection->in_cleanup)
3163 return; /* Prevent double cleanup. */ 3172 return; /* Prevent double cleanup. */
@@ -3237,6 +3246,8 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
3237 char *line; 3246 char *line;
3238 size_t line_len; 3247 size_t line_len;
3239 enum MHD_Result ret; 3248 enum MHD_Result ret;
3249 mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
3250 MHD_thread_ID_match_current_ (connection->pid) );
3240 3251
3241 connection->in_idle = true; 3252 connection->in_idle = true;
3242 while (! connection->suspended) 3253 while (! connection->suspended)
@@ -3933,7 +3944,7 @@ MHD_queue_response (struct MHD_Connection *connection,
3933#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) 3944#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
3934 if ( (! connection->suspended) && 3945 if ( (! connection->suspended) &&
3935 (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) && 3946 (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) &&
3936 (! MHD_thread_ID_match_current_ (connection->pid.ID)) ) 3947 (! MHD_thread_ID_match_current_ (connection->pid)) )
3937 { 3948 {
3938#ifdef HAVE_MESSAGES 3949#ifdef HAVE_MESSAGES
3939 MHD_DLOG (daemon, 3950 MHD_DLOG (daemon,