commit a10c64c79337431924830db9e82f6c1c70994942
parent 88fee01b55e7b49026fbbdcbb4d890e90cd3b743
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 16 Mar 2017 23:52:35 +0300
Revert "MHD_run_from_select(): removed ability to run epoll"
This partially reverts commit 875e27c51b57bd8bfa7109c61c92d7b4678b204f.
Diffstat:
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Mar 16 23:45:29 MSK 2017
+ Allow again to run MHD in external epoll mode by
+ MHD_run_from_select() - this allow unification of user code
+ and produce no harm for performance. Especially useful with
+ MHD_USE_AUTO flag. -EG
+
Thu Mar 16 23:12:07 MSK 2017
Idle connection should be disconnected *after* "timeout" number of
second, not *before* this number. -EG/VT
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -3441,7 +3441,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
{
fd_set es;
if (0 != (daemon->options &
- (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_POLL | MHD_USE_EPOLL)) )
+ (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_POLL)) )
return MHD_NO;
if (NULL == read_fd_set || NULL == write_fd_set)
return MHD_NO;
@@ -3455,6 +3455,17 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
FD_ZERO (&es);
except_fd_set = &es;
}
+ if (0 != (daemon->options & MHD_USE_EPOLL))
+ {
+#ifdef EPOLL_SUPPORT
+ int ret;
+ ret = MHD_epoll (daemon, MHD_NO);
+ MHD_cleanup_connections (daemon);
+ return ret;
+#else /* ! EPOLL_SUPPORT */
+ return MHD_NO;
+#endif /* ! EPOLL_SUPPORT */
+ }
return internal_run_from_select (daemon, read_fd_set,
write_fd_set, except_fd_set);
}