[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 10/14: Minor simplification for ALPN protocols code
From: |
gnunet |
Subject: |
[libmicrohttpd] 10/14: Minor simplification for ALPN protocols code |
Date: |
Tue, 19 Apr 2022 19:31:17 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit ae4fcbad73324878198b8d5d3a156281d1bcd125
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon Apr 18 13:21:46 2022 +0300
Minor simplification for ALPN protocols code
---
src/microhttpd/daemon.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 81b3afa9..21b82131 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2576,19 +2576,17 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
#if (GNUTLS_VERSION_NUMBER + 0 >= 0x030200)
if (! daemon->disable_alpn)
{
- gnutls_datum_t prts[2];
- const char prt1[] = "http/1.1"; /* Registered code for HTTP/1.1 */
- const char prt2[] = "http/1.0"; /* Registered code for HTTP/1.0 */
-
- prts[0].data = (void *) prt1;
- prts[0].size = MHD_STATICSTR_LEN_ (prt1);
- prts[1].data = (void *) prt2;
- prts[1].size = MHD_STATICSTR_LEN_ (prt2);
+ static const char prt1[] = "http/1.1"; /* Registered code for HTTP/1.1 */
+ static const char prt2[] = "http/1.0"; /* Registered code for HTTP/1.0 */
+ static const gnutls_datum_t prts[2] =
+ { {_MHD_DROP_CONST (prt1), MHD_STATICSTR_LEN_ (prt1)},
+ {_MHD_DROP_CONST (prt2), MHD_STATICSTR_LEN_ (prt2)} };
+
if (GNUTLS_E_SUCCESS !=
gnutls_alpn_set_protocols (connection->tls_session,
prts,
sizeof(prts) / sizeof(prts[0]),
- 0 /* || GNUTLS_ALPN_SERVER_PRECEDENCE */))
+ 0 /* | GNUTLS_ALPN_SERVER_PRECEDENCE */))
{
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 04/14: microhttpd.h: removed empty line, (continued)
- [libmicrohttpd] 04/14: microhttpd.h: removed empty line, gnunet, 2022/04/19
- [libmicrohttpd] 03/14: Refactored create response functions., gnunet, 2022/04/19
- [libmicrohttpd] 02/14: Added _MHD_EXTERN to the all public functions definitions, gnunet, 2022/04/19
- [libmicrohttpd] 06/14: Added new API function MHD_create_response_from_buffer_static(), gnunet, 2022/04/19
- [libmicrohttpd] 07/14: Fixed drop of 'const' when building internal error response, gnunet, 2022/04/19
- [libmicrohttpd] 12/14: microhttpd.h: minor doxy improvement, gnunet, 2022/04/19
- [libmicrohttpd] 08/14: Fixed missing 'const' qualifiers, gnunet, 2022/04/19
- [libmicrohttpd] 05/14: MHD_get_version(): fixed signed value bit shift, gnunet, 2022/04/19
- [libmicrohttpd] 09/14: Added workaround for external APIs, gnunet, 2022/04/19
- [libmicrohttpd] 11/14: Added new API function MHD_create_response_from_buffer_copy(), gnunet, 2022/04/19
- [libmicrohttpd] 10/14: Minor simplification for ALPN protocols code,
gnunet <=
- [libmicrohttpd] 14/14: doc/examples: Fixed drop of 'const' qualifiers, gnunet, 2022/04/19
- [libmicrohttpd] 13/14: src/examples: Fixed drop of 'const' qualifiers and minor fixes., gnunet, 2022/04/19