Browse Source

One more flag renamed: MHD_USE_EPOLL_TURBO -> MHD_USE_TURBO.
Hopefully last one for now.

Evgeny Grin (Karlson2k) 9 years ago
parent
commit
e067df9397

+ 2 - 5
doc/libmicrohttpd.texi

@@ -523,12 +523,9 @@ call has fundamentally lower complexity (O(1) for @code{epoll()}
 vs. O(n) for @code{select()}/@code{poll()} where n is the number of
 open connections).
 
-@item MHD_USE_EPOLL_TURBO
+@item MHD_USE_TURBO
 @cindex performance
-Enable optimizations to aggressively improve performance.  Note that
-the option is a slight misnomer, as these days it also enables optimziations
-that are unrelated to @code{MHD_USE_EPOLL}.  Hence it is OK to
-use this option with other event loops.
+Enable optimizations to aggressively improve performance.
 
 Currently, the optimizations this option enables are based on
 opportunistic reads and writes.  Bascially, MHD will simply try to

+ 1 - 1
src/examples/benchmark.c

@@ -136,7 +136,7 @@ main (int argc, char *const *argv)
 #endif
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_SUPPRESS_DATE_NO_CLOCK
 #ifdef EPOLL_SUPPORT
-			| MHD_USE_EPOLL | MHD_USE_EPOLL_TURBO
+			| MHD_USE_EPOLL | MHD_USE_TURBO
 #endif
 			,
                         atoi (argv[1]),

+ 1 - 1
src/examples/benchmark_https.c

@@ -182,7 +182,7 @@ main (int argc, char *const *argv)
 					      MHD_RESPMEM_PERSISTENT);
   d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_TLS
 #ifdef EPOLL_SUPPORT
-			| MHD_USE_EPOLL | MHD_USE_EPOLL_TURBO
+			| MHD_USE_EPOLL | MHD_USE_TURBO
 #endif
 			,
                         atoi (argv[1]),

+ 11 - 2
src/include/microhttpd.h

@@ -720,11 +720,20 @@ enum MHD_FLAG
   MHD_USE_DUAL_STACK = MHD_USE_IPv6 | 2048,
 
   /**
-   * Enable `epoll()` turbo.  Disables certain calls to `shutdown()`
-   * and enables aggressive non-blocking optimisitc reads.
+   * Enable `turbo`.  Disables certain calls to `shutdown()`,
+   * enables aggressive non-blocking optimistic reads and
+   * other potentially unsafe optimizations.
    * Most effects only happen with #MHD_USE_EPOLL.
    */
+  MHD_USE_TURBO = 4096,
+
+  /** @deprecated */
   MHD_USE_EPOLL_TURBO = 4096,
+#if 0 /* Will be marked for real deprecation later. */
+#define MHD_USE_EPOLL_TURBO \
+  _MHD_DEPR_IN_MACRO("Value MHD_USE_EPOLL_TURBO is deprecated, use MHD_USE_TURBO") \
+  MHD_USE_TURBO
+#endif /* 0 */
 
   /**
    * Enable suspend/resume functions, which also implies setting up

+ 1 - 1
src/microhttpd/connection.c

@@ -506,7 +506,7 @@ MHD_connection_mark_closed_ (struct MHD_Connection *connection)
 
   connection->state = MHD_CONNECTION_CLOSED;
   connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
-  if (0 == (daemon->options & MHD_USE_EPOLL_TURBO))
+  if (0 == (daemon->options & MHD_USE_TURBO))
     {
 #ifdef HTTPS_SUPPORT
       /* For TLS connection use shutdown of TLS layer

+ 2 - 2
src/microhttpd/daemon.c

@@ -2252,7 +2252,7 @@ internal_add_connection (struct MHD_Daemon *daemon,
 #ifdef EPOLL_SUPPORT
   if (0 != (daemon->options & MHD_USE_EPOLL))
     {
-      if (0 == (daemon->options & MHD_USE_EPOLL_TURBO))
+      if (0 == (daemon->options & MHD_USE_TURBO))
 	{
 	  struct epoll_event event;
 
@@ -2602,7 +2602,7 @@ MHD_add_connection (struct MHD_Daemon *daemon,
   else
     sk_nonbl = !0;
 
-  if ( (0 != (daemon->options & MHD_USE_EPOLL_TURBO)) &&
+  if ( (0 != (daemon->options & MHD_USE_TURBO)) &&
        (! MHD_socket_noninheritable_ (client_socket)) )
     {
 #ifdef HAVE_MESSAGES