gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] 51/154: gnutls cork integration


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 51/154: gnutls cork integration
Date: Mon, 19 Aug 2019 10:16:03 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository libmicrohttpd.

commit 5304f73f9e8ebeafc1b80f2033b7c3add1169e75
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Jul 22 18:28:02 2019 +0200

    gnutls cork integration
---
 src/microhttpd/mhd_send.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 34c8e99f..b77d6614 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -170,11 +170,16 @@ MHD_send_on_connection_ (struct MHD_Connection 
*connection,
 #endif
 
 #ifdef HTTPS_SUPPORT
+
   if (using_tls)
   {
-    int i;
-    if (i > SSIZE_MAX)
-      i = SSIZE_MAX;
+    if (want_cork && ! have_cork)
+    {
+      gnutls_record_cork (connection->tls_session);
+      connection->sk_tcp_nodelay_on = false;
+    }
+    if (buffer_size > SSIZE_MAX)
+      buffer_size = SSIZE_MAX;
     ret = gnutls_record_send (connection->tls_session,
                               buffer,
                               buffer_size);
@@ -198,6 +203,12 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
      * sent amount smaller than provided amount, as TLS
      * connections may break data into smaller parts for sending. */
 #endif /* EPOLL_SUPPORT */
+
+    if (! want_cork && have_cork)
+    {
+      (void) gnutls_record_uncork (connection->tls_session, 0);
+      connection->sk_tcp_nodelay_on = true;
+    }
   }
   else
 #endif
@@ -288,13 +299,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
     }
 #endif
 
-  /*
-  // pseudo-code for gnutls corking
-  if (have_more_data && !corked)
-    gnutls_record_cork(connection->tls_session);
-  if (!have_more_data && corked)
-    gnutls_record_uncork(connection->tls_session);
-  */
   return ret;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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