gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/02: daemon.c: fixed: set TCP_NODELAY for externally a


From: gnunet
Subject: [libmicrohttpd] 01/02: daemon.c: fixed: set TCP_NODELAY for externally added connections as well if platform suppots TCP_CORK or TCP_NOPUSH
Date: Tue, 01 Dec 2020 19:24:39 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 5df71088736f5695d0cbf570d7f9d6971a38349d
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Dec 1 20:06:44 2020 +0300

    daemon.c: fixed: set TCP_NODELAY for externally added connections as well
    if platform suppots TCP_CORK or TCP_NOPUSH
---
 src/microhttpd/daemon.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 62e981e6..2f0a2dcc 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2459,6 +2459,20 @@ new_connection_prepare_ (struct MHD_Daemon *daemon,
     return MHD_NO;
   }
   connection->sk_cork_on = false;
+#if defined(MHD_TCP_CORK_NOPUSH) || defined(MHD_USE_MSG_MORE)
+  /* We will use TCP_CORK or TCP_NOPUSH or MSG_MORE to control
+     transmission, disable Nagle's algorithm (always) */
+  if ( (0 != MHD_socket_set_nodelay_ (client_socket,
+                                      true)) &&
+       (EOPNOTSUPP != errno) )
+  {
+#ifdef HAVE_MESSAGES
+    MHD_DLOG (daemon,
+              _ ("Failed to disable TCP Nagle on socket: %s\n"),
+              MHD_socket_last_strerr_ ());
+#endif
+  }
+#endif
 
   connection->connection_timeout = daemon->connection_timeout;
   if (NULL == (connection->addr = malloc (addrlen)))
@@ -3507,20 +3521,6 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
     }
     return MHD_NO;
   }
-#if defined(MHD_TCP_CORK_NOPUSH) || defined(MHD_USE_MSG_MORE)
-  /* We will use TCP_CORK or TCP_NOPUSH or MSG_MORE to control
-     transmission, disable Nagle's algorithm (always) */
-  if ( (0 != MHD_socket_set_nodelay_ (s,
-                                      true)) &&
-       (EOPNOTSUPP != errno) )
-  {
-#ifdef HAVE_MESSAGES
-    MHD_DLOG (daemon,
-              _ ("Failed to disable TCP Nagle on socket: %s\n"),
-              MHD_socket_last_strerr_ ());
-#endif
-  }
-#endif
 #if ! defined(USE_ACCEPT4) || ! defined(HAVE_SOCK_NONBLOCK)
   if (! MHD_socket_nonblocking_ (s))
   {

-- 
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]