diff options
Diffstat (limited to 'src/microhttpd/connection_https.c')
-rw-r--r-- | src/microhttpd/connection_https.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/microhttpd/connection_https.c b/src/microhttpd/connection_https.c index ff1812c4..3d4b0bdb 100644 --- a/src/microhttpd/connection_https.c +++ b/src/microhttpd/connection_https.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libmicrohttpd | 2 | This file is part of libmicrohttpd |
3 | Copyright (C) 2007, 2008, 2010 Daniel Pittman and Christian Grothoff | 3 | Copyright (C) 2007, 2008, 2010 Daniel Pittman and Christian Grothoff |
4 | Copyright (C) 2015-2021 Karlson2k (Evgeny Grin) | ||
4 | 5 | ||
5 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 7 | modify it under the terms of the GNU Lesser General Public |
@@ -24,6 +25,7 @@ | |||
24 | * compiled if ENABLE_HTTPS is set. | 25 | * compiled if ENABLE_HTTPS is set. |
25 | * @author Sagie Amir | 26 | * @author Sagie Amir |
26 | * @author Christian Grothoff | 27 | * @author Christian Grothoff |
28 | * @author Karlson2k (Evgeny Grin) | ||
27 | */ | 29 | */ |
28 | 30 | ||
29 | #include "internal.h" | 31 | #include "internal.h" |
@@ -108,16 +110,16 @@ MHD_run_tls_handshake_ (struct MHD_Connection *connection) | |||
108 | if ((MHD_TLS_CONN_INIT == connection->tls_state) || | 110 | if ((MHD_TLS_CONN_INIT == connection->tls_state) || |
109 | (MHD_TLS_CONN_HANDSHAKING == connection->tls_state)) | 111 | (MHD_TLS_CONN_HANDSHAKING == connection->tls_state)) |
110 | { | 112 | { |
111 | /* GnuTLS uses sendmsg() (when available) to send outgoing message | 113 | #if 0 |
112 | * by single system call therefore there is no need to wait for | 114 | /* According to real-live testing, Nagel's Algorithm is not blocking |
113 | * additional data after sendmsg(). TLS handshake requires several packets | 115 | * partial packets on just connected sockets on modern OSes. As TLS setup |
114 | * exchange so set TCP_NODELAY here to avoid delay before each outgoing | 116 | * is performed as the fist action upon socket connection, the next |
115 | * packet is pushed to the network from kernel network buffers. | 117 | * optimisation typically is not required. If any specific OS will |
116 | * As a drawback, this may result in a larger number of IP packet being | 118 | * require this optimization, it could be enabled by allowing the next |
117 | * send on platforms without sendmsg() support, but luckily such platforms | 119 | * lines for this specific OS. */ |
118 | * are now rare and they don't provide best performance anyway. */ | ||
119 | if (_MHD_ON != connection->sk_nodelay) | 120 | if (_MHD_ON != connection->sk_nodelay) |
120 | MHD_connection_set_nodelay_state_ (connection, true); | 121 | MHD_connection_set_nodelay_state_ (connection, true); |
122 | #endif | ||
121 | ret = gnutls_handshake (connection->tls_session); | 123 | ret = gnutls_handshake (connection->tls_session); |
122 | if (ret == GNUTLS_E_SUCCESS) | 124 | if (ret == GNUTLS_E_SUCCESS) |
123 | { | 125 | { |