gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r38121 - in libmicrohttpd: doc src/include src/microhttpd s


From: gnunet
Subject: [GNUnet-SVN] r38121 - in libmicrohttpd: doc src/include src/microhttpd src/testcurl
Date: Tue, 11 Oct 2016 17:21:32 +0200

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

Modified:
   libmicrohttpd/doc/libmicrohttpd.texi
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/testcurl/test_quiesce.c
Log:
Rename 'MHD_USE_PIPE_FOR_SHUTDOWN' -> 'MHD_USE_ITC' to reflect real meaning of 
option

Modified: libmicrohttpd/doc/libmicrohttpd.texi
===================================================================
--- libmicrohttpd/doc/libmicrohttpd.texi        2016-10-11 15:21:29 UTC (rev 
38120)
+++ libmicrohttpd/doc/libmicrohttpd.texi        2016-10-11 15:21:32 UTC (rev 
38121)
@@ -562,7 +562,7 @@
 with using a thread pool; if it is used,
 @code{MHD_OPTION_THREAD_POOL_SIZE} is ignored.
 
address@hidden MHD_USE_PIPE_FOR_SHUTDOWN
address@hidden MHD_USE_ITC
 @cindex quiesce
 Force MHD to use a signal pipe to notify the event loop (of threads)
 of our shutdown.  This is required if an appliction uses
@@ -643,12 +643,12 @@
 socket).  In other words, the default is as large as possible.
 
 If the connection limit is reached, MHD's behavior depends a bit on
-other options.  If @code{MHD_USE_PIPE_FOR_SHUTDOWN} was given, MHD
+other options.  If @code{MHD_USE_ITC} was given, MHD
 will stop accepting connections on the listen socket.  This will cause
 the operating system to queue connections (up to the @code{listen()}
 limit) above the connection limit.  Those connections will be held
 until MHD is done processing at least one of the active connections.
-If @code{MHD_USE_PIPE_FOR_SHUTDOWN} is not set, then MHD will continue
+If @code{MHD_USE_ITC} is not set, then MHD will continue
 to @code{accept()} and immediately @code{close()} these connections.
 
 Note that if you set a low connection limit, you can easily get into
@@ -1548,7 +1548,7 @@
 HTTP client, or if you are building a proxy.
 
 If you use this API in conjunction with a internal select or a thread
-pool, you must set the option @code{MHD_USE_PIPE_FOR_SHUTDOWN} to
+pool, you must set the option @code{MHD_USE_ITC} to
 ensure that the freshly added connection is immediately processed by
 MHD.
 
@@ -2900,7 +2900,7 @@
 @item MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET
 Get whether shutdown on listen socket to signal other
 threads is supported. If not supported flag
-MHD_USE_PIPE_FOR_SHUTDOWN is automatically forced.
+MHD_USE_ITC is automatically forced.
 
 @item MHD_FEATURE_SOCKETPAIR
 Get whether a @code{socketpair()} is used internally instead of

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2016-10-11 15:21:29 UTC (rev 
38120)
+++ libmicrohttpd/src/include/microhttpd.h      2016-10-11 15:21:32 UTC (rev 
38121)
@@ -635,23 +635,25 @@
   MHD_USE_EPOLL_INTERNALLY
 
   /**
-   * Force MHD to use a signal pipe to notify the event loop (of
-   * threads) of our shutdown.  This is required if an appliction uses
-   * #MHD_USE_SELECT_INTERNALLY or #MHD_USE_THREAD_PER_CONNECTION and
-   * then performs #MHD_quiesce_daemon (which eliminates our ability
-   * to signal termination via the listen socket).  In these modes,
-   * #MHD_quiesce_daemon will fail if this option was not set.  Also,
-   * use of this option is automatic (as in, you do not even have to
-   * specify it), if #MHD_USE_NO_LISTEN_SOCKET is specified.  In
-   * "external" `select()` mode, this option is always simply ignored.
-   * MHD can be build for use a pair of sockets instead of a pipe.
-   * Pair of sockets is forced on W32.
-   *
-   * You must also use this option if you use internal select mode
-   * or a thread pool in conjunction with #MHD_add_connection.
+   * Use inter-thread communication channel.
+   * #MHD_USE_ITC can be used with internal select/poll/other
+   * or #MHD_USE_THREAD_PER_CONNECTION and is ignored with any
+   * "external" mode.
+   * It's required for use of #MHD_quiesce_daemon
+   * or #MHD_add_connection.
+   * This option is enforced by #MHD_USE_SUSPEND_RESUME or
+   * #MHD_USE_NO_LISTEN_SOCKET.
+   * #MHD_USE_ITC is always used automatically on platforms
+   * where select()/poll()/other ignore shutdown of listen
+   * socket.
    */
-  MHD_USE_PIPE_FOR_SHUTDOWN = 1024,
+  MHD_USE_ITC = 1024,
 
+/** @deprecated */
+#define MHD_USE_PIPE_FOR_SHUTDOWN \
+  _MHD_DEPR_IN_MACRO("Value MHD_USE_PIPE_FOR_SHUTDOWN is deprecated, use 
MHD_USE_ITC") \
+  MHD_USE_ITC
+
   /**
    * Use a single socket for IPv4 and IPv6.
    */
@@ -668,9 +670,9 @@
 
   /**
    * Enable suspend/resume functions, which also implies setting up
-   * pipes to signal resume.
+   * ITC to signal resume.
    */
-  MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_PIPE_FOR_SHUTDOWN,
+  MHD_USE_SUSPEND_RESUME = 8192 | MHD_USE_ITC,
 
   /**
    * Enable TCP_FASTOPEN option.  This option is only available on Linux with a
@@ -1634,7 +1636,7 @@
  * that an existing thread is still using it).
  *
  * Note that some thread modes require the caller to have passed
- * #MHD_USE_PIPE_FOR_SHUTDOWN when using this API.  If this daemon is
+ * #MHD_USE_ITC when using this API.  If this daemon is
  * in one of those modes and this option was not given to
  * #MHD_start_daemon, this function will return #MHD_INVALID_SOCKET.
  *
@@ -1666,7 +1668,7 @@
  *
  * If you use this API in conjunction with a internal select or a
  * thread pool, you must set the option
- * #MHD_USE_PIPE_FOR_SHUTDOWN to ensure that the freshly added
+ * #MHD_USE_ITC to ensure that the freshly added
  * connection is immediately processed by MHD.
  *
  * The given client socket will be managed (and closed!) by MHD after
@@ -1968,7 +1970,7 @@
  * thread-per-connection!) for a while.
  *
  * If you use this API in conjunction with a internal select or a
- * thread pool, you must set the option #MHD_USE_PIPE_FOR_SHUTDOWN to
+ * thread pool, you must set the option #MHD_USE_ITC to
  * ensure that a resumed connection is immediately processed by MHD.
  *
  * Suspended connections continue to count against the total number of
@@ -2798,7 +2800,7 @@
   /**
    * Get whether shutdown on listen socket to signal other
    * threads is supported. If not supported flag
-   * #MHD_USE_PIPE_FOR_SHUTDOWN is automatically forced.
+   * #MHD_USE_ITC is automatically forced.
    */
   MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET = 8,
 

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2016-10-11 15:21:29 UTC (rev 
38120)
+++ libmicrohttpd/src/microhttpd/daemon.c       2016-10-11 15:21:32 UTC (rev 
38121)
@@ -2112,7 +2112,7 @@
  * thread-per-connection!) for a while.
  *
  * If you use this API in conjunction with a internal select or a
- * thread pool, you must set the option #MHD_USE_PIPE_FOR_SHUTDOWN to
+ * thread pool, you must set the option #MHD_USE_ITC to
  * ensure that a resumed connection is immediately processed by MHD.
  *
  * Suspended connections continue to count against the total number of
@@ -2307,7 +2307,7 @@
  *
  * If you use this API in conjunction with a internal select or a
  * thread pool, you must set the option
- * #MHD_USE_PIPE_FOR_SHUTDOWN to ensure that the freshly added
+ * #MHD_USE_ITC to ensure that the freshly added
  * connection is immediately processed by MHD.
  *
  * The given client socket will be managed (and closed!) by MHD after
@@ -2878,7 +2878,7 @@
      place. */
   if ( (MHD_INVALID_SOCKET != daemon->socket_fd) &&
        (MHD_ITC_IS_VALID_(daemon->itc)) &&
-       (0 != (daemon->options & MHD_USE_PIPE_FOR_SHUTDOWN)) &&
+       (0 != (daemon->options & MHD_USE_ITC)) &&
        ( (daemon->connections == daemon->connection_limit) ||
          (MHD_YES == daemon->at_limit) ) )
     {
@@ -3742,7 +3742,7 @@
  * sure that socket is not used anymore, call #MHD_stop_daemon.
  *
  * Note that some thread modes require the caller to have passed
- * #MHD_USE_PIPE_FOR_SHUTDOWN when using this API.  If this daemon is
+ * #MHD_USE_ITC when using this API.  If this daemon is
  * in one of those modes and this option was not given to
  * #MHD_start_daemon, this function will return #MHD_INVALID_SOCKET.
  *
@@ -3765,7 +3765,7 @@
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
-               "Using MHD_quiesce_daemon in this mode requires 
MHD_USE_PIPE_FOR_SHUTDOWN\n");
+               "Using MHD_quiesce_daemon in this mode requires MHD_USE_ITC\n");
 #endif
       return MHD_INVALID_SOCKET;
     }
@@ -4448,7 +4448,7 @@
   daemon->custom_error_log_cls = stderr;
 #endif
 #ifdef HAVE_LISTEN_SHUTDOWN
-  use_pipe = (0 != (daemon->options & (MHD_USE_NO_LISTEN_SOCKET | 
MHD_USE_PIPE_FOR_SHUTDOWN)));
+  use_pipe = (0 != (daemon->options & (MHD_USE_NO_LISTEN_SOCKET | 
MHD_USE_ITC)));
 #else
   use_pipe = 1; /* yes, must use pipe to signal shutdown */
 #endif
@@ -5271,7 +5271,7 @@
     {
       /* fd might be MHD_INVALID_SOCKET here due to 'MHD_quiesce_daemon' */
       if ( (MHD_INVALID_SOCKET != fd) &&
-           (0 == (daemon->options & MHD_USE_PIPE_FOR_SHUTDOWN)) )
+           (0 == (daemon->options & MHD_USE_ITC)) )
        (void) shutdown (fd,
                          SHUT_RDWR);
     }

Modified: libmicrohttpd/src/testcurl/test_quiesce.c
===================================================================
--- libmicrohttpd/src/testcurl/test_quiesce.c   2016-10-11 15:21:29 UTC (rev 
38120)
+++ libmicrohttpd/src/testcurl/test_quiesce.c   2016-10-11 15:21:32 UTC (rev 
38121)
@@ -204,12 +204,12 @@
   cbc.size = 2048;
   cbc.pos = 0;
   if (pool_count > 0) {
-    d = MHD_start_daemon (type | MHD_USE_DEBUG | MHD_USE_PIPE_FOR_SHUTDOWN | 
poll_flag,
+    d = MHD_start_daemon (type | MHD_USE_DEBUG | MHD_USE_ITC | poll_flag,
                           11080, NULL, NULL, &ahc_echo, "GET",
                           MHD_OPTION_THREAD_POOL_SIZE, pool_count, 
MHD_OPTION_END);
 
   } else {
-    d = MHD_start_daemon (type | MHD_USE_DEBUG | MHD_USE_PIPE_FOR_SHUTDOWN | 
poll_flag,
+    d = MHD_start_daemon (type | MHD_USE_DEBUG | MHD_USE_ITC | poll_flag,
                           11080, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
   }
   if (d == NULL)




reply via email to

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