[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 02/02: Speed-up TLS handshake
From: |
gnunet |
Subject: |
[libmicrohttpd] 02/02: Speed-up TLS handshake |
Date: |
Tue, 29 Dec 2020 13:40:06 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit e8258c92e6cd32f93f7a2b2c8b9605451e8113df
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Dec 29 15:39:21 2020 +0300
Speed-up TLS handshake
---
src/microhttpd/connection_https.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/microhttpd/connection_https.c
b/src/microhttpd/connection_https.c
index 7307d48b..6b50d3b4 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -33,6 +33,7 @@
#include "response.h"
#include "mhd_mono_clock.h"
#include <gnutls/gnutls.h>
+#include "mhd_send.h"
/**
@@ -107,6 +108,15 @@ MHD_run_tls_handshake_ (struct MHD_Connection *connection)
if ((MHD_TLS_CONN_INIT == connection->tls_state) ||
(MHD_TLS_CONN_HANDSHAKING == connection->tls_state))
{
+ /* GnuTLS uses sendmsg() (when available) to combine outgoing message
+ * into the single packet therefore there is no need to wait for
+ * additional data after sendmsg(). TLS handshake requires several packets
+ * exchange so set TCP_NODELAY here to avoid delay after each outgoing
+ * packet. As drawback it results in less more packet fragmentation
+ * on platforms without sendmsg() support, but luckily such platforms
+ * are now rare and they don't provide best performance anyway. */
+ if (_MHD_ON != connection->sk_nodelay)
+ MHD_connection_set_nodelay_state_ (connection, true);
ret = gnutls_handshake (connection->tls_session);
if (ret == GNUTLS_E_SUCCESS)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.