[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 06/08: MHD_queue_response(): refuse 101 code when not su
From: |
gnunet |
Subject: |
[libmicrohttpd] 06/08: MHD_queue_response(): refuse 101 code when not supported |
Date: |
Sun, 13 Mar 2022 18:33:29 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 3a6b50c8215c1c21caaee89d814af9bde321a2ba
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Mar 13 12:08:24 2022 +0300
MHD_queue_response(): refuse 101 code when not supported
---
src/microhttpd/connection.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 93c3ebfb..0280bdab 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -5229,6 +5229,27 @@ MHD_queue_response (struct MHD_Connection *connection,
}
}
#endif /* UPGRADE_SUPPORT */
+ if (MHD_HTTP_SWITCHING_PROTOCOLS == status_code)
+ {
+#ifdef UPGRADE_SUPPORT
+ if (NULL == response->upgrade_handler)
+ {
+#ifdef HAVE_MESSAGES
+ MHD_DLOG (daemon,
+ _ ("Application used status code 101 \"Switching Protocols\" "
\
+ "with non-'upgrade' response!\n"));
+#endif /* HAVE_MESSAGES */
+ return MHD_NO;
+ }
+#else /* ! UPGRADE_SUPPORT */
+#ifdef HAVE_MESSAGES
+ MHD_DLOG (daemon,
+ _ ("Application used status code 101 \"Switching Protocols\", " \
+ "but this MHD was built without \"Upgrade\" support!\n"));
+#endif /* HAVE_MESSAGES */
+ return MHD_NO;
+#endif /* ! UPGRADE_SUPPORT */
+ }
if ( (100 > status_code) ||
(999 < status_code) )
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (1a46bfd6 -> f2565a62), gnunet, 2022/03/13
- [libmicrohttpd] 04/08: Disallowed successful responses for CONNECT requests, gnunet, 2022/03/13
- [libmicrohttpd] 03/08: Added warning in log if application-defined Content-Length is used, gnunet, 2022/03/13
- [libmicrohttpd] 02/08: Added separate internal "responseIcy" flag., gnunet, 2022/03/13
- [libmicrohttpd] 01/08: upgrade response: set response size to zero, gnunet, 2022/03/13
- [libmicrohttpd] 06/08: MHD_queue_response(): refuse 101 code when not supported,
gnunet <=
- [libmicrohttpd] 05/08: MHD_queue_response(): clarified log message, gnunet, 2022/03/13
- [libmicrohttpd] 07/08: Simplified function for determining needs for reply body and headers, gnunet, 2022/03/13
- [libmicrohttpd] 08/08: MHD_set_response_options(): check whether the new flags could be used, gnunet, 2022/03/13