From b0d406484de8a9cbe14079804b595aca53bbb40e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 19 Jul 2019 19:33:00 +0200 Subject: [PATCH] fixes --- src/microhttpd/mhd_send.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 6215af65..074ba115 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c @@ -99,7 +99,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, if (buffer_size > MHD_SCKT_SEND_MAX_SIZE_) buffer_size = MHD_SCKT_SEND_MAX_SIZE_; /* return value limit */ - // new code... /* Get socket options, change/set options if necessary. */ switch (options) { @@ -148,11 +147,15 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, TCP_CORK, (const void *) &on_val, sizeof (on_val))) + { + connection->sk_tcp_nodelay = false; + } else if (0 == setsockopt (connection->socket_fd, IPPROTO_TCP, TCP_NODELAY, (const void *) &on_val, - sizeof (on_val))) { + sizeof (on_val))) + { connection->sk_tcp_nodelay = true; } //setsockopt (cork-on); // or nodelay on // + update connection->sk_tcp_nodelay_on @@ -266,14 +269,13 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, { if (! have_cork && want_cork && ! have_more) { - //setsockopt (cork-off); // or nodelay off // + update connection->sk_tcp_nodelay_on if (0 == setsockopt (connection->socket_fd, IPPROTO_TCP, TCP_CORK, - (const void *) &off_val, // WHY OFF? - sizeof (off_val))) + (const void *) &on_val, + sizeof (on_val))) { - connection->sk_tcp_nodelay_on = true; // ??? + connection->sk_tcp_nodelay_on = false; } else if (0 == setsockopt (connection->socket_fd, IPPROTO_TCP,