gnunet-svn
[Top][All Lists]
Advanced

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

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


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

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

Modified:
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/microhttpd/mhd_itc.h
Log:
Renamed 'MHD_pipe_get_write_fd_' -> 'MHD_itc_r_fd_', 'MHD_pipe_get_write_fd_' 
-> 'MHD_itc_w_fd_'
Doxy added.

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2016-10-11 15:21:11 UTC (rev 
38114)
+++ libmicrohttpd/src/microhttpd/daemon.c       2016-10-11 15:21:14 UTC (rev 
38115)
@@ -1376,7 +1376,7 @@
 #if WINDOWS
           if (! MHD_INVALID_PIPE_(daemon->itc) )
             {
-              if (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_ (daemon->itc),
+              if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
                                         &rs,
                                         &maxsock,
                                         FD_SETSIZE))
@@ -1414,7 +1414,7 @@
 #if WINDOWS
           /* drain signaling pipe before other processing */
           if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
-               (FD_ISSET (MHD_pipe_get_read_fd_ (daemon->itc),
+               (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
                           &rs)) )
             MHD_pipe_drain_ (daemon->itc);
 #endif
@@ -1461,7 +1461,7 @@
           if (! MHD_INVALID_PIPE_(daemon->itc))
             {
               p[1].events |= POLLIN;
-              p[1].fd = MHD_pipe_get_read_fd_ (daemon->itc);
+              p[1].fd = MHD_itc_r_fd_ (daemon->itc);
               p[1].revents = 0;
               extra_slot = 1;
             }
@@ -2705,7 +2705,7 @@
   /* Do it before any other processing so new signals
      will trigger select again and will be processed */
   if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
-       (FD_ISSET (MHD_pipe_get_read_fd_ (daemon->itc),
+       (FD_ISSET (MHD_itc_r_fd_ (daemon->itc),
                   read_fd_set)) )
     MHD_pipe_drain_ (daemon->itc);
 
@@ -2841,7 +2841,7 @@
         }
     }
   if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
-       (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_ (daemon->itc),
+       (! MHD_add_to_fd_set_ (MHD_itc_r_fd_ (daemon->itc),
                               &rs,
                               &maxsock,
                               FD_SETSIZE)) )
@@ -2854,7 +2854,7 @@
         {
           FD_CLR (daemon->socket_fd,
                   &rs);
-          if (! MHD_add_to_fd_set_ (MHD_pipe_get_read_fd_(daemon->itc),
+          if (! MHD_add_to_fd_set_ (MHD_itc_r_fd_(daemon->itc),
                                     &rs,
                                     &maxsock,
                                     FD_SETSIZE))
@@ -3004,7 +3004,7 @@
     poll_pipe = -1;
     if (! MHD_INVALID_PIPE_(daemon->itc))
       {
-       p[poll_server].fd = MHD_pipe_get_read_fd_ (daemon->itc);
+       p[poll_server].fd = MHD_itc_r_fd_ (daemon->itc);
        p[poll_server].events = POLLIN;
        p[poll_server].revents = 0;
         poll_pipe = (int) poll_server;
@@ -3185,7 +3185,7 @@
     }
   if (! MHD_INVALID_PIPE_(daemon->itc))
     {
-      p[poll_count].fd = MHD_pipe_get_read_fd_ (daemon->itc);
+      p[poll_count].fd = MHD_itc_r_fd_ (daemon->itc);
       p[poll_count].events = POLLIN;
       p[poll_count].revents = 0;
       poll_pipe = poll_count;
@@ -3493,7 +3493,7 @@
              be expected to be rare... FIXME (a construction similar
              to what we did with the `upgrade_marker` should do) */
           if ( (! MHD_INVALID_PIPE_(daemon->itc)) &&
-               (MHD_pipe_get_read_fd_ (daemon->itc) == events[i].data.fd) )
+               (MHD_itc_r_fd_ (daemon->itc) == events[i].data.fd) )
             {
               /* It's OK to drain pipe here as all external
                  conditions will be processed later. */
@@ -4327,10 +4327,10 @@
     {
       event.events = EPOLLIN | EPOLLET;
       event.data.ptr = NULL;
-      event.data.fd = MHD_pipe_get_read_fd_ (daemon->itc);
+      event.data.fd = MHD_itc_r_fd_ (daemon->itc);
       if (0 != epoll_ctl (daemon->epoll_fd,
                           EPOLL_CTL_ADD,
-                          MHD_pipe_get_read_fd_ (daemon->itc),
+                          MHD_itc_r_fd_ (daemon->itc),
                           &event))
         {
 #ifdef HAVE_MESSAGES
@@ -4480,7 +4480,7 @@
   }
   if ( (0 == (flags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
        (1 == use_pipe) &&
-       (! MHD_SCKT_FD_FITS_FDSET_(MHD_pipe_get_read_fd_ (daemon->itc),
+       (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
                                   NULL)) )
     {
 #ifdef HAVE_MESSAGES
@@ -4998,7 +4998,7 @@
                 }
             }
           if ( (0 == (flags & (MHD_USE_POLL | MHD_USE_EPOLL))) &&
-               (! MHD_SCKT_FD_FITS_FDSET_(MHD_pipe_get_read_fd_ (daemon->itc),
+               (! MHD_SCKT_FD_FITS_FDSET_(MHD_itc_r_fd_ (daemon->itc),
                                           NULL)) )
             {
 #ifdef HAVE_MESSAGES
@@ -5238,7 +5238,7 @@
   event.data.ptr = NULL;
   if (0 != epoll_ctl (daemon->epoll_fd,
                      EPOLL_CTL_ADD,
-                     MHD_pipe_get_write_fd_ (daemon->itc),
+                     MHD_itc_w_fd_ (daemon->itc),
                      &event))
     MHD_PANIC (_("Failed to add wpipe to epoll set to signal termination\n"));
 }

Modified: libmicrohttpd/src/microhttpd/mhd_itc.h
===================================================================
--- libmicrohttpd/src/microhttpd/mhd_itc.h      2016-10-11 15:21:11 UTC (rev 
38114)
+++ libmicrohttpd/src/microhttpd/mhd_itc.h      2016-10-11 15:21:14 UTC (rev 
38115)
@@ -75,9 +75,19 @@
 #define MHD_itc_activate_(itc, str) \
   ((write((itc), (const void*)&_MHD_itc_wr_data, 8) > 0) || (EAGAIN == errno))
 
-#define MHD_pipe_get_read_fd_(pip) (pip)
+/**
+ * Return read FD of @a itc which can be used for poll(), select() etc.
+ * @param itc the itc to get FD
+ * @return FD of read side
+ */
+#define MHD_itc_r_fd_(itc) ((int)(itc))
 
-#define MHD_pipe_get_write_fd_(pip) (pip)
+/**
+ * Return write FD of @a itc
+ * @param itc the itc to get FD
+ * @return FD of write side
+ */
+#define MHD_itc_w_fd_(itc) ((int)(itc))
 
 /**
  * drain data from real pipe
@@ -153,9 +163,19 @@
   ((write((itc).fd[1], (const void*)(str), 1) > 0) || (EAGAIN == errno))
 
 
-#define MHD_pipe_get_read_fd_(pip) ((pip).fd[0])
+/**
+ * Return read FD of @a itc which can be used for poll(), select() etc.
+ * @param itc the itc to get FD
+ * @return FD of read side
+ */
+#define MHD_itc_r_fd_(itc) ((itc).fd[0])
 
-#define MHD_pipe_get_write_fd_(pip) ((pip).fd[1])
+/**
+ * Return write FD of @a itc
+ * @param itc the itc to get FD
+ * @return FD of write side
+ */
+#define MHD_itc_w_fd_(itc) ((itc).fd[1])
 
 /**
  * drain data from real pipe
@@ -228,9 +248,19 @@
   ((send((itc).sk[1], (const char*)(str), 1, 0) > 0) || \
    (MHD_SCKT_ERR_IS_EAGAIN_(MHD_socket_get_error_())))
 
-#define MHD_pipe_get_read_fd_(pip) ((pip).sk[0])
+/**
+ * Return read FD of @a itc which can be used for poll(), select() etc.
+ * @param itc the itc to get FD
+ * @return FD of read side
+ */
+#define MHD_itc_r_fd_(itc) ((itc).sk[0])
 
-#define MHD_pipe_get_write_fd_(pip) ((pip).sk[1])
+/**
+ * Return write FD of @a itc
+ * @param itc the itc to get FD
+ * @return FD of write side
+ */
+#define MHD_itc_w_fd_(itc) ((itc).sk[1])
 
 /**
  * Drain data from emulated pipe




reply via email to

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