Przeglądaj źródła

MHD_run_from_select(): removed ability to run epoll
fd_sets don not provide any useful information for epoll, so MHD_run() should be used
for epoll-based daemons.

Evgeny Grin (Karlson2k) 9 lat temu
rodzic
commit
875e27c51b
2 zmienionych plików z 8 dodań i 12 usunięć
  1. 7 0
      ChangeLog
  2. 1 12
      src/microhttpd/daemon.c

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+Wed Mar 15 23:29:59 MSK 2017
+	Prevented socket read/write if connection is suspended.
+	Added missing resets of 'connection->in_idle'.
+	Reworked handling of suspended connection: ensure that
+	connection is not disconnected by timeout, always
+	updated read/write states right after suspending. -EG
+
 Wed Mar 15 21:02:26 MSK 2017
 	Added new enum value MHD_CONNECTION_INFO_CONNECTION_TIMEOUT
 	to get connection timeout by MHD_get_connection_info(). -EG

+ 1 - 12
src/microhttpd/daemon.c

@@ -3436,7 +3436,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_INTERNAL_POLLING_THREAD | MHD_USE_POLL | MHD_USE_EPOLL)) )
     return MHD_NO;
   if (NULL == read_fd_set || NULL == write_fd_set)
     return MHD_NO;
@@ -3450,17 +3450,6 @@ 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);
 }