[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 02/05: Improved resume_suspended_connection
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 02/05: Improved resume_suspended_connections() handling: Removed extra call from MHD_run(), moved call in MHD_epoll() so resumed connections are handled without delay |
Date: |
Sun, 14 May 2017 14:11:20 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit fefb1e5b60131bc6bf73046e902d5cb14debc1f1
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sun May 14 14:31:10 2017 +0300
Improved resume_suspended_connections() handling:
Removed extra call from MHD_run(), moved call in MHD_epoll() so resumed
connections are handled without delay
---
src/microhttpd/daemon.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 74686269..9a3409a2 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3467,7 +3467,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
}
/* Resuming external connections when using an extern mainloop */
- if (0 != (daemon->options & MHD_ALLOW_SUSPEND_RESUME))
+ if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
resume_suspended_connections (daemon);
return internal_run_from_select (daemon, read_fd_set,
@@ -4226,6 +4226,11 @@ MHD_epoll (struct MHD_Daemon *daemon,
MHD_PANIC (_("Failed to remove listen FD from epoll set\n"));
daemon->listen_socket_in_epoll = false;
}
+
+ if ( (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME)) &&
+ (MHD_YES == resume_suspended_connections (daemon)) )
+ may_block = MHD_NO;
+
if (MHD_YES == may_block)
{
if (MHD_YES == MHD_get_timeout (daemon,
@@ -4364,11 +4369,6 @@ MHD_epoll (struct MHD_Daemon *daemon,
run_epoll_for_upgrade (daemon);
#endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
- /* we handle resumes here because we may have ready connections
- that will not be placed into the epoll list immediately. */
- if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
- (void) resume_suspended_connections (daemon);
-
/* process events for connections */
prev = daemon->eready_tail;
while (NULL != (pos = prev))
@@ -4451,10 +4451,6 @@ MHD_run (struct MHD_Daemon *daemon)
if ( (daemon->shutdown) ||
(0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) )
return MHD_NO;
- /* Resume resuming connection (if any) so they will be processing
- * in this turn. */
- if (0 != (daemon->options & MHD_ALLOW_SUSPEND_RESUME))
- resume_suspended_connections (daemon);
if (0 != (daemon->options & MHD_USE_POLL))
{
MHD_poll (daemon, MHD_NO);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libmicrohttpd] branch master updated (858483b5 -> 6c991e09), gnunet, 2017/05/14
- [GNUnet-SVN] [libmicrohttpd] 01/05: internal_run_from_select(): remove extra call for epoll run as epoll called directly, gnunet, 2017/05/14
- [GNUnet-SVN] [libmicrohttpd] 03/05: thread_main_handle_connection(): update states of connection after resume, gnunet, 2017/05/14
- [GNUnet-SVN] [libmicrohttpd] 05/05: Handle resumed connections and closed "upgraded" connections in thread-per-connection mode with select(), do not use zero delay in MHD_poll_listen_socket() if connections are resumed, gnunet, 2017/05/14
- [GNUnet-SVN] [libmicrohttpd] 02/05: Improved resume_suspended_connections() handling: Removed extra call from MHD_run(), moved call in MHD_epoll() so resumed connections are handled without delay,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 04/05: MHD_poll_listen_socket(): handle resumed connections and closed "upgraded" connections, gnunet, 2017/05/14