summaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index bf01ba9b..16655f65 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3224,6 +3224,19 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
}
return MHD_NO;
}
+#if defined(MHD_TCP_CORK_NOPUSH) || defined(HAVE_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))
+ {
+#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))
{
@@ -6223,7 +6236,6 @@ MHD_start_daemon_va (unsigned int flags,
}
}
#endif /* HAVE_GETSOCKNAME */
-
if ( (MHD_INVALID_SOCKET != listen_fd) &&
(! MHD_socket_nonblocking_ (listen_fd)) )
{