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.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index bbebfc57..95823992 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3769,9 +3769,7 @@ MHD_queue_response (struct MHD_Connection *connection,
3769 unsigned int status_code, 3769 unsigned int status_code,
3770 struct MHD_Response *response) 3770 struct MHD_Response *response)
3771{ 3771{
3772#ifdef UPGRADE_SUPPORT
3773 struct MHD_Daemon *daemon; 3772 struct MHD_Daemon *daemon;
3774#endif /* UPGRADE_SUPPORT */
3775 3773
3776 if ( (NULL == connection) || 3774 if ( (NULL == connection) ||
3777 (NULL == response) || 3775 (NULL == response) ||
@@ -3779,8 +3777,18 @@ MHD_queue_response (struct MHD_Connection *connection,
3779 ( (MHD_CONNECTION_HEADERS_PROCESSED != connection->state) && 3777 ( (MHD_CONNECTION_HEADERS_PROCESSED != connection->state) &&
3780 (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) ) 3778 (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) )
3781 return MHD_NO; 3779 return MHD_NO;
3782#ifdef UPGRADE_SUPPORT
3783 daemon = connection->daemon; 3780 daemon = connection->daemon;
3781 if ( (!connection->suspended) &&
3782 (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) &&
3783 (!MHD_thread_ID_match_current_(connection->pid.ID)) )
3784 {
3785#ifdef HAVE_MESSAGES
3786 MHD_DLOG (daemon,
3787 _("Attempted to queue response on wrong thread!\n"));
3788#endif
3789 return MHD_NO;
3790 }
3791#ifdef UPGRADE_SUPPORT
3784 if ( (NULL != response->upgrade_handler) && 3792 if ( (NULL != response->upgrade_handler) &&
3785 (0 == (daemon->options & MHD_ALLOW_UPGRADE)) ) 3793 (0 == (daemon->options & MHD_ALLOW_UPGRADE)) )
3786 { 3794 {