[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 05/06: Upgraded connection: replaced two checks with ass
From: |
gnunet |
Subject: |
[libmicrohttpd] 05/06: Upgraded connection: replaced two checks with asserts |
Date: |
Fri, 31 Mar 2023 09:22:51 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 05b59a0199523ad87bfc87330a1f46c0be4eba79
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Mar 30 18:12:40 2023 +0200
Upgraded connection: replaced two checks with asserts
The response should be checked by "queue" function.
---
src/microhttpd/response.c | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index fc006da2..d3bf1ab7 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -1942,22 +1942,14 @@ MHD_response_execute_upgrade_ (struct MHD_Response
*response,
MHD_thread_ID_match_current_ (connection->pid) );
#endif /* MHD_USE_THREADS */
- if (0 == (daemon->options & MHD_ALLOW_UPGRADE))
- return MHD_NO;
-
- if (NULL ==
- MHD_get_response_element_n_ (response, MHD_HEADER_KIND,
- MHD_HTTP_HEADER_UPGRADE,
- MHD_STATICSTR_LEN_ ( \
- MHD_HTTP_HEADER_UPGRADE)))
- {
-#ifdef HAVE_MESSAGES
- MHD_DLOG (daemon,
- _ ("Invalid response for upgrade: " \
- "application failed to set the 'Upgrade' header!\n"));
-#endif
- return MHD_NO;
- }
+ /* "Upgrade" responses accepted only if MHD_ALLOW_UPGRADE is enabled */
+ mhd_assert (0 != (daemon->options & MHD_ALLOW_UPGRADE));
+ /* The header was checked when response queued */
+ mhd_assert (NULL != \
+ MHD_get_response_element_n_ (response, MHD_HEADER_KIND,
+ MHD_HTTP_HEADER_UPGRADE,
+ MHD_STATICSTR_LEN_ ( \
+ MHD_HTTP_HEADER_UPGRADE)));
urh = MHD_calloc_ (1, sizeof (struct MHD_UpgradeResponseHandle));
if (NULL == urh)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (ec981dfe -> da42f22c), gnunet, 2023/03/31
- [libmicrohttpd] 03/06: Upgraded TLS: fixed inefficient communication, gnunet, 2023/03/31
- [libmicrohttpd] 02/06: microhttpd.h: fixed typo in doxy, gnunet, 2023/03/31
- [libmicrohttpd] 01/06: ChangeLog: corrected, gnunet, 2023/03/31
- [libmicrohttpd] 04/06: connection.c: cosmetics, gnunet, 2023/03/31
- [libmicrohttpd] 05/06: Upgraded connection: replaced two checks with asserts,
gnunet <=
- [libmicrohttpd] 06/06: Upgraded TLS: use more available memory for pumping the data, gnunet, 2023/03/31