gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]