diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-08 16:39:58 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-11-08 16:39:58 +0300 |
commit | 8629a47f831d7b6b56300039035c188fb6eaa65e (patch) | |
tree | cec7db56f29544f86d5f6afa600fafbe641fb696 | |
parent | cec5aed907524f47ee06ebc4f9704441df5d1023 (diff) | |
download | libmicrohttpd-8629a47f831d7b6b56300039035c188fb6eaa65e.tar.gz libmicrohttpd-8629a47f831d7b6b56300039035c188fb6eaa65e.zip |
Upgraded connection: added missing check
-rw-r--r-- | src/microhttpd/response.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index d592007d..78e874d0 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -1953,6 +1953,15 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
1953 | MHD_STATICSTR_LEN_ ( \ | 1953 | MHD_STATICSTR_LEN_ ( \ |
1954 | MHD_HTTP_HEADER_UPGRADE))); | 1954 | MHD_HTTP_HEADER_UPGRADE))); |
1955 | 1955 | ||
1956 | if (! connection->sk_nonblck) | ||
1957 | { | ||
1958 | #ifdef HAVE_MESSAGES | ||
1959 | MHD_DLOG (daemon, | ||
1960 | _ ("Cannot execute \"upgrade\" as the socket is in " \ | ||
1961 | "the blocking mode.\n")); | ||
1962 | #endif | ||
1963 | return MHD_NO; | ||
1964 | } | ||
1956 | urh = MHD_calloc_ (1, sizeof (struct MHD_UpgradeResponseHandle)); | 1965 | urh = MHD_calloc_ (1, sizeof (struct MHD_UpgradeResponseHandle)); |
1957 | if (NULL == urh) | 1966 | if (NULL == urh) |
1958 | return MHD_NO; | 1967 | return MHD_NO; |