gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 94/154: simplify


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 94/154: simplify
Date: Mon, 19 Aug 2019 10:16:46 +0200

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

ng0 pushed a commit to branch master
in repository libmicrohttpd.

commit 16d0ccc48b2715a1b83d08c178af1d4d6647bd81
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jul 25 20:17:33 2019 +0200

    simplify
---
 src/microhttpd/mhd_send.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 21e70bc2..49fd1edf 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -90,12 +90,20 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
       return 0; // return type error
     }
 
+  ret = -1;
 #if TCP_CORK
-  ret = setsockopt (connection->socket_fd,
-                    IPPROTO_TCP,
-                    TCP_CORK,
-                    (const void *) &off_val,
-                    sizeof (off_val));
+  if (want_cork)
+    ret = setsockopt (connection->socket_fd,
+                      IPPROTO_TCP,
+                      TCP_CORK,
+                      (const void *) &on_val,
+                      sizeof (on_val));
+  else
+    ret = setsockopt (connection->socket_fd,
+                      IPPROTO_TCP,
+                      TCP_CORK,
+                      (const void *) &off_val,
+                      sizeof (off_val));
 #elif TCP_NODELAY
   ret = setsockopt (connection->socket_fd,
                     IPPROTO_TCP,
@@ -108,8 +116,6 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
                     TCP_NOPUSH,
                     (const void *) &on_val,
                     sizeof (on_val));
-#else
-  ret = -1;
 #endif
 
   if (0 == 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]