gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 04/07: Streamlined internal usage of MHD_US


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 04/07: Streamlined internal usage of MHD_USE_ITC flag.
Date: Sun, 26 Mar 2017 12:52:42 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 8cdcc7806b033c3d02d03c58a5c348ee6b53d3bf
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sun Mar 26 12:54:26 2017 +0300

    Streamlined internal usage of MHD_USE_ITC flag.
---
 src/microhttpd/daemon.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 89771188..a868c764 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5313,7 +5313,6 @@ MHD_start_daemon_va (unsigned int flags,
   const struct sockaddr *servaddr = NULL;
   socklen_t addrlen;
   unsigned int i;
-  int use_itc;
   enum MHD_FLAG eflags; /* same type as in MHD_Daemon */
   enum MHD_FLAG *pflags;
 
@@ -5443,14 +5442,16 @@ MHD_start_daemon_va (unsigned int flags,
 #endif
       *pflags |= MHD_USE_INTERNAL_POLLING_THREAD;
     }
+  if (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD))
+    *pflags &= ~MHD_USE_ITC; /* useless if we are using 'external' select */
+  else
+    {
 #ifdef HAVE_LISTEN_SHUTDOWN
-  use_itc = (0 != (*pflags & (MHD_USE_NO_LISTEN_SOCKET | MHD_USE_ITC)));
-#else
-  use_itc = 1; /* yes, must use ITC to signal thread */
+      if (0 != (*pflags & MHD_USE_NO_LISTEN_SOCKET))
 #endif
-  if (0 == (*pflags & MHD_USE_INTERNAL_POLLING_THREAD))
-    use_itc = 0; /* useless if we are using 'external' select */
-  if (use_itc)
+        *pflags |= MHD_USE_ITC; /* yes, must use ITC to signal thread */
+    }
+  if (0 != (*pflags & MHD_USE_ITC))
   {
     if (! MHD_itc_init_ (daemon->itc))
     {
@@ -5462,20 +5463,19 @@ MHD_start_daemon_va (unsigned int flags,
       free (daemon);
       return NULL;
     }
-  }
-  if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
-       (1 == use_itc) &&
-       (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
-                                  NULL)) )
-    {
+    if ( (0 == (*pflags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
+         (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
+                                    NULL)) )
+      {
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               _("file descriptor for inter-thread communication channel 
exceeds maximum value\n"));
+        MHD_DLOG (daemon,
+                  _("file descriptor for inter-thread communication channel 
exceeds maximum value\n"));
 #endif
-      MHD_itc_destroy_chk_ (daemon->itc);
-      free (daemon);
-      return NULL;
-    }
+        MHD_itc_destroy_chk_ (daemon->itc);
+        free (daemon);
+        return NULL;
+      }
+  }
 #ifdef DAUTH_SUPPORT
   daemon->digest_auth_rand_size = 0;
   daemon->digest_auth_random = NULL;

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



reply via email to

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