gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 31/154: combine ifs, fix uninitialized var


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 31/154: combine ifs, fix uninitialized var error
Date: Mon, 19 Aug 2019 10:15:43 +0200

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

ng0 pushed a commit to branch master
in repository libmicrohttpd.

commit 34c88c2244f91a4fd1e7feaf3b5b656cc66a25c9
Author: ng0 <address@hidden>
AuthorDate: Fri Jul 19 18:11:40 2019 +0000

    combine ifs, fix uninitialized var error
---
 src/microhttpd/mhd_send.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 5e529646..f087a326 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -80,7 +80,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
   bool have_more;
   bool use_corknopush;
   bool using_tls = false;
-  /* The socket. */
   MHD_socket s = connection->socket_fd;
   ssize_t ret;
   const MHD_SCKT_OPT_BOOL_ off_val = 0;
@@ -135,9 +134,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
 #endif
 
 #if TCP_CORK
-  if (use_corknopush)
-  {
-    if (have_cork && ! want_cork)
+  if ((use_corknopush) && (have_cork && ! want_cork))
     {
       if (0 == setsockopt (connection->socket_fd,
                            IPPROTO_TCP,
@@ -160,16 +157,13 @@ MHD_send_on_connection_ (struct MHD_Connection 
*connection,
       // at least since Linux 2.2 and both can be combined since
       // Linux 2.5.71. See tcp(7). No other system in 2019-06 has TCP_CORK.
     }
-  }
 #elif TCP_NOPUSH
   /*
  * TCP_NOPUSH on FreeBSD is equal to cork on Linux, with the
  * exception that we know that TCP_NOPUSH will definitely
  * exist and we can disregard TCP_NODELAY unless requested.
  */
-  if (use_corknopush)
-  {
-    if (have_cork && ! want_cork)
+  if ((use_corknopush) && (have_cork && ! want_cork))
     {
       setsockopt (connection->socket_fd,
                   IPPROTO_TCP,
@@ -178,12 +172,9 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
                   sizeof (on_val));
       connection->sk_tcp_nodelay_on = false;
     }
-  }
 #endif
 #if TCP_NODELAY
-  if (! use_corknopush)
-  {
-    if (! have_cork && want_cork)
+  if ((! use_corknopush) && (! have_cork && want_cork))
     {
       setsockopt (connection->socket_fd,
                   IPPROTO_TCP,
@@ -192,12 +183,12 @@ MHD_send_on_connection_ (struct MHD_Connection 
*connection,
                   sizeof (off_val));
       connection->sk_tcp_nodelay_on = false;
     }
-  }
 #endif
 
 #ifdef HTTPS_SUPPORT
   if (using_tls)
   {
+    int i;
     if (i > SSIZE_MAX)
       i = SSIZE_MAX;
     ret = gnutls_record_send (connection->tls_session,

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



reply via email to

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