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.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 54556167..e3880e8a 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3158,6 +3158,8 @@ MHD_queue_response (struct MHD_Connection *connection,
3158 unsigned int status_code, 3158 unsigned int status_code,
3159 struct MHD_Response *response) 3159 struct MHD_Response *response)
3160{ 3160{
3161 struct MHD_Daemon *daemon = connection->daemon;
3162
3161 if ( (NULL == connection) || 3163 if ( (NULL == connection) ||
3162 (NULL == response) || 3164 (NULL == response) ||
3163 (NULL != connection->response) || 3165 (NULL != connection->response) ||
@@ -3168,20 +3170,31 @@ MHD_queue_response (struct MHD_Connection *connection,
3168 (NULL != response->upgrade_handler) ) 3170 (NULL != response->upgrade_handler) )
3169 { 3171 {
3170#ifdef HAVE_MESSAGES 3172#ifdef HAVE_MESSAGES
3171 MHD_DLOG (connection->daemon, 3173 MHD_DLOG (daemon,
3172 "Application used invalid status code for 'upgrade' response!\n"); 3174 "Application used invalid status code for 'upgrade' response!\n");
3173#endif 3175#endif
3174 return MHD_NO; 3176 return MHD_NO;
3175 } 3177 }
3176 if ( (NULL != response->upgrade_handler) && 3178 if ( (NULL != response->upgrade_handler) &&
3177 (0 == (connection->daemon->options & MHD_USE_SUSPEND_RESUME)) ) 3179 (0 == (daemon->options & MHD_USE_SUSPEND_RESUME)) )
3178 { 3180 {
3179#ifdef HAVE_MESSAGES 3181#ifdef HAVE_MESSAGES
3180 MHD_DLOG (connection->daemon, 3182 MHD_DLOG (daemon,
3181 "Application attempted 'upgrade' without setting MHD_USE_SUSPEND_RESUME!\n"); 3183 "Application attempted 'upgrade' without setting MHD_USE_SUSPEND_RESUME!\n");
3182#endif 3184#endif
3183 return MHD_NO; 3185 return MHD_NO;
3184 } 3186 }
3187 if ( (NULL != response->upgrade_handler) &&
3188 (0 != (MHD_USE_EPOLL & daemon->options)) &&
3189 (0 != (MHD_USE_TLS & daemon->options)) &&
3190 (MHD_USE_TLS_EPOLL_UPGRADE != (MHD_USE_TLS_EPOLL_UPGRADE & daemon->options)) )
3191 {
3192#ifdef HAVE_MESSAGES
3193 MHD_DLOG (daemon,
3194 "Application attempted 'upgrade' HTTPS connection in epoll mode without setting MHD_USE_HTTPS_EPOLL_UPGRADE!\n");
3195#endif
3196 return MHD_NO;
3197 }
3185 MHD_increment_response_rc (response); 3198 MHD_increment_response_rc (response);
3186 connection->response = response; 3199 connection->response = response;
3187 connection->responseCode = status_code; 3200 connection->responseCode = status_code;