commit e067df9397516bd671dcfd079ec561371399468d
parent 51c1f5e65bff0eee79d87874ee5b8f1514c38032
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 10 Nov 2016 17:39:56 +0300
One more flag renamed: MHD_USE_EPOLL_TURBO -> MHD_USE_TURBO.
Hopefully last one for now.
Diffstat:
6 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/doc/libmicrohttpd.texi b/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
diff --git a/src/examples/benchmark.c b/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]),
diff --git a/src/examples/benchmark_https.c b/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]),
diff --git a/src/include/microhttpd.h b/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
diff --git a/src/microhttpd/connection.c b/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
diff --git a/src/microhttpd/daemon.c b/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