diff options
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 6b0501e8..95b60f14 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -3437,33 +3437,21 @@ MHD_queue_response (struct MHD_Connection *connection, | |||
3437 | (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) ) | 3437 | (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) ) |
3438 | return MHD_NO; | 3438 | return MHD_NO; |
3439 | daemon = connection->daemon; | 3439 | daemon = connection->daemon; |
3440 | if ( (MHD_HTTP_SWITCHING_PROTOCOLS != status_code) && | ||
3441 | (NULL != response->upgrade_handler) ) | ||
3442 | { | ||
3443 | #ifdef HAVE_MESSAGES | ||
3444 | MHD_DLOG (daemon, | ||
3445 | _("Application used invalid status code for 'upgrade' response!\n")); | ||
3446 | #endif | ||
3447 | return MHD_NO; | ||
3448 | } | ||
3449 | if ( (NULL != response->upgrade_handler) && | 3440 | if ( (NULL != response->upgrade_handler) && |
3450 | (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && | 3441 | (0 == (daemon->options & MHD_ALLOW_UPGRADE)) ) |
3451 | (0 == (daemon->options & MHD_USE_SUSPEND_RESUME)) ) | ||
3452 | { | 3442 | { |
3453 | #ifdef HAVE_MESSAGES | 3443 | #ifdef HAVE_MESSAGES |
3454 | MHD_DLOG (daemon, | 3444 | MHD_DLOG (daemon, |
3455 | _("Application attempted 'upgrade' without setting MHD_USE_SUSPEND_RESUME!\n")); | 3445 | _("Attempted 'upgrade' connection on daemon without MHD_ALLOW_UPGRADE option!\n")); |
3456 | #endif | 3446 | #endif |
3457 | return MHD_NO; | 3447 | return MHD_NO; |
3458 | } | 3448 | } |
3459 | if ( (NULL != response->upgrade_handler) && | 3449 | if ( (MHD_HTTP_SWITCHING_PROTOCOLS != status_code) && |
3460 | (0 != (MHD_USE_EPOLL & daemon->options)) && | 3450 | (NULL != response->upgrade_handler) ) |
3461 | (0 != (MHD_USE_TLS & daemon->options)) && | ||
3462 | (MHD_USE_TLS_EPOLL_UPGRADE != (MHD_USE_TLS_EPOLL_UPGRADE & daemon->options)) ) | ||
3463 | { | 3451 | { |
3464 | #ifdef HAVE_MESSAGES | 3452 | #ifdef HAVE_MESSAGES |
3465 | MHD_DLOG (daemon, | 3453 | MHD_DLOG (daemon, |
3466 | _("Application attempted 'upgrade' HTTPS connection in epoll mode without setting MHD_USE_HTTPS_EPOLL_UPGRADE!\n")); | 3454 | _("Application used invalid status code for 'upgrade' response!\n")); |
3467 | #endif | 3455 | #endif |
3468 | return MHD_NO; | 3456 | return MHD_NO; |
3469 | } | 3457 | } |