gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r38111 - libmicrohttpd/src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r38111 - libmicrohttpd/src/microhttpd
Date: Tue, 11 Oct 2016 17:21:02 +0200

Author: Karlson2k
Date: 2016-10-11 17:21:02 +0200 (Tue, 11 Oct 2016)
New Revision: 38111

Modified:
   libmicrohttpd/src/microhttpd/connection.c
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/microhttpd/internal.h
Log:
Renamed 'MHD_Daemon.wpipe' -> 'MHD_Daemon.itc'

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2016-10-11 15:20:59 UTC (rev 
38110)
+++ libmicrohttpd/src/microhttpd/connection.c   2016-10-11 15:21:02 UTC (rev 
38111)
@@ -520,8 +520,8 @@
      thread-per-connection mode, signal the main thread
      to resume accepting connections */
   if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
-       (! MHD_INVALID_PIPE_ (daemon->wpipe)) &&
-       (1 != MHD_pipe_write_ (daemon->wpipe,
+       (! MHD_INVALID_PIPE_ (daemon->itc)) &&
+       (1 != MHD_pipe_write_ (daemon->itc,
                               "c",
                               1)) )
     {

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2016-10-11 15:20:59 UTC (rev 
38110)
+++ libmicrohttpd/src/microhttpd/daemon.c       2016-10-11 15:21:02 UTC (rev 
38111)
@@ -1374,9 +1374,9 @@
              goto exit;
            }
 #if WINDOWS
-          if (! MHD_INVALID_PIPE_(daemon->wpipe) )
+          if (! MHD_INVALID_PIPE_(daemon->itc) )
             {
-              if (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_ (daemon->wpipe),
+              if (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_ (daemon->itc),
                                         &rs,
                                         &maxsock,
                                         FD_SETSIZE))
@@ -1413,10 +1413,10 @@
            }
 #if WINDOWS
           /* drain signaling pipe before other processing */
-          if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-               (FD_ISSET (MHD_pipe_get_read_fd_ (daemon->wpipe),
+          if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
+               (FD_ISSET (MHD_pipe_get_read_fd_ (daemon->itc),
                           &rs)) )
-            MHD_pipe_drain_ (daemon->wpipe);
+            MHD_pipe_drain_ (daemon->itc);
 #endif
           if (MHD_NO ==
               call_handlers (con,
@@ -1458,10 +1458,10 @@
            }
 #if WINDOWS
           extra_slot = 0;
-          if (! MHD_INVALID_PIPE_(daemon->wpipe))
+          if (! MHD_INVALID_PIPE_(daemon->itc))
             {
               p[1].events |= POLLIN;
-              p[1].fd = MHD_pipe_get_read_fd_ (daemon->wpipe);
+              p[1].fd = MHD_pipe_get_read_fd_ (daemon->itc);
               p[1].revents = 0;
               extra_slot = 1;
             }
@@ -1485,9 +1485,9 @@
            }
 #if WINDOWS
           /* drain signaling pipe before other processing */
-          if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
+          if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
                (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
-            MHD_pipe_drain_ (daemon->wpipe);
+            MHD_pipe_drain_ (daemon->itc);
 #endif
           if (MHD_NO ==
               call_handlers (con,
@@ -2028,8 +2028,8 @@
     }
   else
     if ( (MHD_YES == external_add) &&
-        (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-        (1 != MHD_pipe_write_ (daemon->wpipe,
+        (! MHD_INVALID_PIPE_(daemon->itc)) &&
+        (1 != MHD_pipe_write_ (daemon->itc,
                                 "n",
                                 1)) )
       {
@@ -2211,8 +2211,8 @@
     MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   connection->resuming = MHD_YES;
   daemon->resuming = MHD_YES;
-  if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-       (1 != MHD_pipe_write_ (daemon->wpipe, "r", 1)) )
+  if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
+       (1 != MHD_pipe_write_ (daemon->itc, "r", 1)) )
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
@@ -2706,10 +2706,10 @@
   /* drain signaling pipe to avoid spinning select */
   /* Do it before any other processing so new signals
      will trigger select again and will be processed */
-  if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-       (FD_ISSET (MHD_pipe_get_read_fd_ (daemon->wpipe),
+  if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
+       (FD_ISSET (MHD_pipe_get_read_fd_ (daemon->itc),
                   read_fd_set)) )
-    MHD_pipe_drain_ (daemon->wpipe);
+    MHD_pipe_drain_ (daemon->itc);
 
   /* Resuming external connections when using an extern mainloop  */
   if (MHD_USE_SUSPEND_RESUME == (daemon->options & mask))
@@ -2842,8 +2842,8 @@
           return MHD_NO;
         }
     }
-  if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-       (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_ (daemon->wpipe),
+  if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
+       (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_ (daemon->itc),
                               &rs,
                               &maxsock,
                               FD_SETSIZE)) )
@@ -2856,7 +2856,7 @@
         {
           FD_CLR (daemon->socket_fd,
                   &rs);
-          if (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_(daemon->wpipe),
+          if (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_(daemon->itc),
                                     &rs,
                                     &maxsock,
                                     FD_SETSIZE))
@@ -2879,7 +2879,7 @@
      only do this optimization if we have a signaling pipe in
      place. */
   if ( (MHD_INVALID_SOCKET != daemon->socket_fd) &&
-       (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
+       (! MHD_INVALID_PIPE_(daemon->itc)) &&
        (0 != (daemon->options & MHD_USE_PIPE_FOR_SHUTDOWN)) &&
        ( (daemon->connections == daemon->connection_limit) ||
          (MHD_YES == daemon->at_limit) ) )
@@ -3004,9 +3004,9 @@
        poll_server++;
       }
     poll_pipe = -1;
-    if (! MHD_INVALID_PIPE_(daemon->wpipe))
+    if (! MHD_INVALID_PIPE_(daemon->itc))
       {
-       p[poll_server].fd = MHD_pipe_get_read_fd_ (daemon->wpipe);
+       p[poll_server].fd = MHD_pipe_get_read_fd_ (daemon->itc);
        p[poll_server].events = POLLIN;
        p[poll_server].revents = 0;
         poll_pipe = (int) poll_server;
@@ -3090,7 +3090,7 @@
        new signals will be processed in next loop */
     if ( (-1 != poll_pipe) &&
          (0 != (p[poll_pipe].revents & POLLIN)) )
-      MHD_pipe_drain_ (daemon->wpipe);
+      MHD_pipe_drain_ (daemon->itc);
 
     /* handle shutdown */
     if (MHD_YES == daemon->shutdown)
@@ -3185,9 +3185,9 @@
       poll_listen = poll_count;
       poll_count++;
     }
-  if (! MHD_INVALID_PIPE_(daemon->wpipe))
+  if (! MHD_INVALID_PIPE_(daemon->itc))
     {
-      p[poll_count].fd = MHD_pipe_get_read_fd_ (daemon->wpipe);
+      p[poll_count].fd = MHD_pipe_get_read_fd_ (daemon->itc);
       p[poll_count].events = POLLIN;
       p[poll_count].revents = 0;
       poll_pipe = poll_count;
@@ -3216,7 +3216,7 @@
     }
   if ( (-1 != poll_pipe) &&
        (0 != (p[poll_pipe].revents & POLLIN)) )
-    MHD_pipe_drain_ (daemon->wpipe);
+    MHD_pipe_drain_ (daemon->itc);
 
   /* handle shutdown */
   if (MHD_YES == daemon->shutdown)
@@ -3491,15 +3491,15 @@
 #endif
           /* UGH: we're storing pointers and fds in the same union
              here; incredibly ugly and somewhat risky, even though a
-             pointer with the same numeric value as the wpipe.fd[0] can
+             pointer with the same numeric value as the itc.fd[0] can
              be expected to be rare... FIXME (a construction similar
              to what we did with the `upgrade_marker` should do) */
-          if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-               (MHD_pipe_get_read_fd_ (daemon->wpipe) == events[i].data.fd) )
+          if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
+               (MHD_pipe_get_read_fd_ (daemon->itc) == events[i].data.fd) )
             {
               /* It's OK to drain pipe here as all external
                  conditions will be processed later. */
-              MHD_pipe_drain_ (daemon->wpipe);
+              MHD_pipe_drain_ (daemon->itc);
               continue;
             }
          if (daemon == events[i].data.ptr)
@@ -3762,7 +3762,7 @@
   ret = daemon->socket_fd;
   if (MHD_INVALID_SOCKET == ret)
     return MHD_INVALID_SOCKET;
-  if ( (MHD_INVALID_PIPE_(daemon->wpipe)) &&
+  if ( (MHD_INVALID_PIPE_(daemon->itc)) &&
        (0 != (daemon->options & (MHD_USE_SELECT_INTERNALLY | 
MHD_USE_THREAD_PER_CONNECTION))) )
     {
 #ifdef HAVE_MESSAGES
@@ -3790,9 +3790,9 @@
          }
         else
 #endif
-        if (! MHD_INVALID_PIPE_(daemon->worker_pool[i].wpipe))
+        if (! MHD_INVALID_PIPE_(daemon->worker_pool[i].itc))
           {
-            if (1 != MHD_pipe_write_ (daemon->worker_pool[i].wpipe,
+            if (1 != MHD_pipe_write_ (daemon->worker_pool[i].itc,
                                       "q",
                                       1))
               MHD_PANIC (_("Failed to signal quiesce via pipe"));
@@ -3813,9 +3813,9 @@
     }
   else
 #endif
-    if (! MHD_INVALID_PIPE_(daemon->wpipe))
+    if (! MHD_INVALID_PIPE_(daemon->itc))
     {
-      if (1 != MHD_pipe_write_ (daemon->wpipe,
+      if (1 != MHD_pipe_write_ (daemon->itc,
                                 "q",
                                 1))
        MHD_PANIC (_("failed to signal quiesce via pipe"));
@@ -4328,15 +4328,15 @@
 #endif
       return MHD_NO;
     }
-  if ( (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
+  if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
        (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) )
     {
       event.events = EPOLLIN | EPOLLET;
       event.data.ptr = NULL;
-      event.data.fd = MHD_pipe_get_read_fd_ (daemon->wpipe);
+      event.data.fd = MHD_pipe_get_read_fd_ (daemon->itc);
       if (0 != epoll_ctl (daemon->epoll_fd,
                           EPOLL_CTL_ADD,
-                          MHD_pipe_get_read_fd_ (daemon->wpipe),
+                          MHD_pipe_get_read_fd_ (daemon->itc),
                           &event))
         {
 #ifdef HAVE_MESSAGES
@@ -4443,7 +4443,7 @@
   daemon->pool_increment = MHD_BUF_INC_SIZE;
   daemon->unescape_callback = &unescape_wrapper;
   daemon->connection_timeout = 0;       /* no timeout */
-  MHD_make_invalid_pipe_ (daemon->wpipe);
+  MHD_make_invalid_pipe_ (daemon->itc);
 #ifdef SOMAXCONN
   daemon->listen_backlog_size = SOMAXCONN;
 #else  /* !SOMAXCONN */
@@ -4462,7 +4462,7 @@
     use_pipe = 0; /* useless if we are using 'external' select */
   if (use_pipe)
   {
-    if (! MHD_itc_init_ (daemon->wpipe))
+    if (! MHD_itc_init_ (daemon->itc))
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
@@ -4472,7 +4472,7 @@
       free (daemon);
       return NULL;
     }
-    if (! MHD_itc_nonblocking_ (daemon->wpipe))
+    if (! MHD_itc_nonblocking_ (daemon->itc))
       {
 #ifdef HAVE_MESSAGES
         MHD_DLOG (daemon,
@@ -4479,7 +4479,7 @@
                  _("Failed to make read side of inter-thread control channel 
non-blocking: %s\n"),
                  MHD_pipe_last_strerror_ ());
 #endif
-        MHD_pipe_close_ (daemon->wpipe);
+        MHD_pipe_close_ (daemon->itc);
         free (daemon);
         return NULL;
       }
@@ -4486,7 +4486,7 @@
   }
   if ( (0 == (flags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
        (1 == use_pipe) &&
-       (! MHD_SCKT_FD_FITS_FDSET_(MHD_pipe_get_read_fd_ (daemon->wpipe),
+       (! MHD_SCKT_FD_FITS_FDSET_(MHD_pipe_get_read_fd_ (daemon->itc),
                                   NULL)) )
     {
 #ifdef HAVE_MESSAGES
@@ -4493,7 +4493,7 @@
       MHD_DLOG (daemon,
                _("file descriptor for control pipe exceeds maximum value\n"));
 #endif
-      MHD_pipe_close_ (daemon->wpipe);
+      MHD_pipe_close_ (daemon->itc);
       free (daemon);
       return NULL;
     }
@@ -4984,7 +4984,7 @@
           /* Always use individual control pipes */
           if (1)
             {
-              if (! MHD_itc_init_ (d->wpipe))
+              if (! MHD_itc_init_ (d->itc))
                 {
 #ifdef HAVE_MESSAGES
                   MHD_DLOG (daemon,
@@ -4993,7 +4993,7 @@
 #endif
                   goto thread_failed;
                 }
-              if (! MHD_itc_nonblocking_(d->wpipe))
+              if (! MHD_itc_nonblocking_(d->itc))
                 {
 #ifdef HAVE_MESSAGES
                   MHD_DLOG (daemon,
@@ -5004,7 +5004,7 @@
                 }
             }
           if ( (0 == (flags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
-               (! MHD_SCKT_FD_FITS_FDSET_(MHD_pipe_get_read_fd_ 
(daemon->wpipe),
+               (! MHD_SCKT_FD_FITS_FDSET_(MHD_pipe_get_read_fd_ (daemon->itc),
                                           NULL)) )
             {
 #ifdef HAVE_MESSAGES
@@ -5011,7 +5011,7 @@
               MHD_DLOG (daemon,
                         _("File descriptor for worker control pipe exceeds 
maximum value\n"));
 #endif
-              MHD_pipe_close_ (d->wpipe);
+              MHD_pipe_close_ (d->itc);
               goto thread_failed;
             }
 
@@ -5117,8 +5117,8 @@
   if (0 != (flags & MHD_USE_SSL))
     gnutls_priority_deinit (daemon->priority_cache);
 #endif
-  if (! MHD_INVALID_PIPE_(daemon->wpipe))
-    MHD_pipe_close_ (daemon->wpipe);
+  if (! MHD_INVALID_PIPE_(daemon->itc))
+    MHD_pipe_close_ (daemon->itc);
   free (daemon);
   return NULL;
 }
@@ -5185,8 +5185,8 @@
       shutdown (pos->socket_fd, SHUT_RDWR);
 #if MHD_WINSOCK_SOCKETS
       if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
-           (! MHD_INVALID_PIPE_(daemon->wpipe)) &&
-           (1 != MHD_pipe_write_ (daemon->wpipe, "e", 1)) )
+           (! MHD_INVALID_PIPE_(daemon->itc)) &&
+           (1 != MHD_pipe_write_ (daemon->itc, "e", 1)) )
         MHD_PANIC (_("Failed to signal shutdown via pipe"));
 #endif
     }
@@ -5226,7 +5226,7 @@
 
 #ifdef EPOLL_SUPPORT
 /**
- * Shutdown epoll()-event loop by adding write end of 'wpipe' to its event set.
+ * Shutdown epoll()-event loop by adding write end of 'itc' to its event set.
  *
  * @param daemon daemon of which the epoll() instance must be signalled
  */
@@ -5235,9 +5235,9 @@
 {
   struct epoll_event event;
 
-  if (MHD_INVALID_PIPE_(daemon->wpipe))
+  if (MHD_INVALID_PIPE_(daemon->itc))
     {
-      /* wpipe was required in this mode, how could this happen? */
+      /* itc was required in this mode, how could this happen? */
       MHD_PANIC (_("Internal error\n"));
     }
   event.events = EPOLLOUT;
@@ -5244,7 +5244,7 @@
   event.data.ptr = NULL;
   if (0 != epoll_ctl (daemon->epoll_fd,
                      EPOLL_CTL_ADD,
-                     MHD_pipe_get_write_fd_ (daemon->wpipe),
+                     MHD_pipe_get_write_fd_ (daemon->itc),
                      &event))
     MHD_PANIC (_("Failed to add wpipe to epoll set to signal termination\n"));
 }
@@ -5287,9 +5287,9 @@
 #endif
        }
     }
-  if (! MHD_INVALID_PIPE_(daemon->wpipe))
+  if (! MHD_INVALID_PIPE_(daemon->itc))
     {
-      if (1 != MHD_pipe_write_ (daemon->wpipe, "e", 1))
+      if (1 != MHD_pipe_write_ (daemon->itc, "e", 1))
        MHD_PANIC (_("Failed to signal shutdown via pipe"));
     }
 #ifdef HAVE_LISTEN_SHUTDOWN
@@ -5323,9 +5323,9 @@
       /* MHD_USE_NO_LISTEN_SOCKET disables thread pools, hence we need to 
check */
       for (i = 0; i < daemon->worker_pool_size; ++i)
        {
-         if (! MHD_INVALID_PIPE_(daemon->worker_pool[i].wpipe))
+         if (! MHD_INVALID_PIPE_(daemon->worker_pool[i].itc))
            {
-             if (1 != MHD_pipe_write_ (daemon->worker_pool[i].wpipe,
+             if (1 != MHD_pipe_write_ (daemon->worker_pool[i].itc,
                                         "e",
                                         1))
                MHD_PANIC (_("Failed to signal shutdown via pipe."));
@@ -5345,9 +5345,9 @@
           /* Individual pipes are always used */
           if (1)
             {
-              if (! MHD_INVALID_PIPE_ (daemon->worker_pool[i].wpipe) )
+              if (! MHD_INVALID_PIPE_ (daemon->worker_pool[i].itc) )
                 {
-                  MHD_pipe_close_ (daemon->worker_pool[i].wpipe);
+                  MHD_pipe_close_ (daemon->worker_pool[i].itc);
                 }
            }
        }
@@ -5402,8 +5402,8 @@
   MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
   MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
 
-  if (! MHD_INVALID_PIPE_(daemon->wpipe))
-    MHD_pipe_close_ (daemon->wpipe);
+  if (! MHD_INVALID_PIPE_(daemon->itc))
+    MHD_pipe_close_ (daemon->itc);
   free (daemon);
 }
 

Modified: libmicrohttpd/src/microhttpd/internal.h
===================================================================
--- libmicrohttpd/src/microhttpd/internal.h     2016-10-11 15:20:59 UTC (rev 
38110)
+++ libmicrohttpd/src/microhttpd/internal.h     2016-10-11 15:21:02 UTC (rev 
38111)
@@ -1354,7 +1354,7 @@
   /**
    * Inter-thread communication channel.
    */
-  MHD_itc_ wpipe;
+  MHD_itc_ itc;
 
   /**
    * Are we shutting down?




reply via email to

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