diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-04-18 13:21:46 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-04-19 18:55:27 +0300 |
commit | ae4fcbad73324878198b8d5d3a156281d1bcd125 (patch) | |
tree | 981544cdc507b2b69480d92027b99c47ffdbc995 /src | |
parent | b6eb14d6469a5d48df977cfcd3b38f2d19e5951f (diff) | |
download | libmicrohttpd-ae4fcbad73324878198b8d5d3a156281d1bcd125.tar.gz libmicrohttpd-ae4fcbad73324878198b8d5d3a156281d1bcd125.zip |
Minor simplification for ALPN protocols code
Diffstat (limited to 'src')
-rw-r--r-- | src/microhttpd/daemon.c | 16 |
1 files 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, | |||
2576 | #if (GNUTLS_VERSION_NUMBER + 0 >= 0x030200) | 2576 | #if (GNUTLS_VERSION_NUMBER + 0 >= 0x030200) |
2577 | if (! daemon->disable_alpn) | 2577 | if (! daemon->disable_alpn) |
2578 | { | 2578 | { |
2579 | gnutls_datum_t prts[2]; | 2579 | static const char prt1[] = "http/1.1"; /* Registered code for HTTP/1.1 */ |
2580 | const char prt1[] = "http/1.1"; /* Registered code for HTTP/1.1 */ | 2580 | static const char prt2[] = "http/1.0"; /* Registered code for HTTP/1.0 */ |
2581 | const char prt2[] = "http/1.0"; /* Registered code for HTTP/1.0 */ | 2581 | static const gnutls_datum_t prts[2] = |
2582 | 2582 | { {_MHD_DROP_CONST (prt1), MHD_STATICSTR_LEN_ (prt1)}, | |
2583 | prts[0].data = (void *) prt1; | 2583 | {_MHD_DROP_CONST (prt2), MHD_STATICSTR_LEN_ (prt2)} }; |
2584 | prts[0].size = MHD_STATICSTR_LEN_ (prt1); | 2584 | |
2585 | prts[1].data = (void *) prt2; | ||
2586 | prts[1].size = MHD_STATICSTR_LEN_ (prt2); | ||
2587 | if (GNUTLS_E_SUCCESS != | 2585 | if (GNUTLS_E_SUCCESS != |
2588 | gnutls_alpn_set_protocols (connection->tls_session, | 2586 | gnutls_alpn_set_protocols (connection->tls_session, |
2589 | prts, | 2587 | prts, |
2590 | sizeof(prts) / sizeof(prts[0]), | 2588 | sizeof(prts) / sizeof(prts[0]), |
2591 | 0 /* || GNUTLS_ALPN_SERVER_PRECEDENCE */)) | 2589 | 0 /* | GNUTLS_ALPN_SERVER_PRECEDENCE */)) |
2592 | { | 2590 | { |
2593 | #ifdef HAVE_MESSAGES | 2591 | #ifdef HAVE_MESSAGES |
2594 | MHD_DLOG (daemon, | 2592 | MHD_DLOG (daemon, |