aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 4fd1b8c6..803d55c2 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3915,16 +3915,21 @@ MHD_epoll (struct MHD_Daemon *daemon,
3915 } 3915 }
3916 if (daemon == events[i].data.ptr) 3916 if (daemon == events[i].data.ptr)
3917 { 3917 {
3918 unsigned int series_length = 0; 3918 /* Check for error conditions on listen socket. */
3919 /* Run 'accept' until it fails or daemon at limit of connections. 3919 /* FIXME: Initiate MHD_quiesce_daemon() to prevent busy waiting? */
3920 * Do not accept more then 10 connections at once. The rest will 3920 if (0 == (events[i].events & (EPOLLERR | EPOLLHUP)))
3921 * be accepted on next turn (level trigger is used for listen 3921 {
3922 * socket). */ 3922 unsigned int series_length = 0;
3923 while ( (MHD_YES == MHD_accept_connection (daemon)) && 3923 /* Run 'accept' until it fails or daemon at limit of connections.
3924 (series_length < 10) && 3924 * Do not accept more then 10 connections at once. The rest will
3925 (daemon->connections < daemon->connection_limit) && 3925 * be accepted on next turn (level trigger is used for listen
3926 (! daemon->at_limit) ) 3926 * socket). */
3927 series_length++; 3927 while ( (MHD_YES == MHD_accept_connection (daemon)) &&
3928 (series_length < 10) &&
3929 (daemon->connections < daemon->connection_limit) &&
3930 (! daemon->at_limit) )
3931 series_length++;
3932 }
3928 continue; 3933 continue;
3929 } 3934 }
3930 /* this is an event relating to a 'normal' connection, 3935 /* this is an event relating to a 'normal' connection,