gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated (858483b5 -> 6c991e09


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (858483b5 -> 6c991e09)
Date: Sun, 14 May 2017 14:11:18 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 858483b5 MHD_connection_update_event_loop_info(): do not update states 
of suspended connections
     new a66ec8da internal_run_from_select(): remove extra call for epoll run 
as epoll called directly
     new fefb1e5b Improved resume_suspended_connections() handling: Removed 
extra call from MHD_run(), moved call in MHD_epoll() so resumed connections are 
handled without delay
     new 76cbe3d3 thread_main_handle_connection(): update states of connection 
after resume
     new 5c71e755 MHD_poll_listen_socket(): handle resumed connections and 
closed "upgraded" connections
     new 6c991e09 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

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog               | 12 ++++++++++++
 src/microhttpd/daemon.c | 46 +++++++++++++++++-----------------------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b9698655..aabf1b9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sun May 14 15:05:00 MSK 2017
+       Fixed resuming connections and closing upgraded connections in select()
+       mode with thread-per-connection. -EG
+
+Sun May 14 14:49:00 MSK 2017
+       Removed extra call to resume connections in MHD_run().
+       Handle resumed connection without delay in epoll mode.
+       Update states of resumed connection after resume in 
thread-per-connection
+       mode.
+       Fixed resuming connections and closing upgraded connections in poll()
+       mode with thread-per-connection. -EG
+
 Thu May 11 22:37:00 MSK 2017
        Faster start really processing data in resumed connections. -EG
 
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index de36296f..9bed84bc 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1878,6 +1878,8 @@ thread_main_handle_connection (void *data)
       if (was_suspended)
         {
           MHD_update_last_activity_ (con); /* Reset timeout timer. */
+          /* Process response queued during suspend and update states. */
+          MHD_connection_handle_idle (con);
           was_suspended = false;
         }
 
@@ -3353,21 +3355,6 @@ internal_run_from_select (struct MHD_Daemon *daemon,
                   read_fd_set)) )
     MHD_itc_clear_ (daemon->itc);
 
-#ifdef EPOLL_SUPPORT
-  if (0 != (daemon->options & MHD_USE_EPOLL))
-    {
-      /* we're in epoll mode, the epoll FD stands for
-        the entire event set! */
-      if (! MHD_SCKT_FD_FITS_FDSET_(daemon->epoll_fd,
-                                    NULL))
-       return MHD_NO; /* poll fd too big, fail hard */
-      if (FD_ISSET (daemon->epoll_fd,
-                    read_fd_set))
-       return MHD_run (daemon);
-      return MHD_YES;
-    }
-#endif
-
   /* select connection thread handling type */
   if ( (MHD_INVALID_SOCKET != (ds = daemon->listen_fd)) &&
        (! daemon->was_quiesced) &&
@@ -3482,7 +3469,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,
@@ -3522,12 +3509,13 @@ MHD_select (struct MHD_Daemon *daemon,
   FD_ZERO (&es);
   maxsock = MHD_INVALID_SOCKET;
   err_state = MHD_NO;
+  if ( (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME)) &&
+       (MHD_YES == resume_suspended_connections (daemon)) &&
+       (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) )
+    may_block = MHD_NO;
+
   if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
     {
-      if ( (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME)) &&
-           (MHD_YES == resume_suspended_connections (daemon)) )
-        may_block = MHD_NO;
-
       /* single-threaded, go over everything */
       if (MHD_NO ==
           internal_get_fdset2 (daemon,
@@ -3910,6 +3898,10 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
       poll_itc_idx = poll_count;
       poll_count++;
     }
+
+  if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
+    (void)resume_suspended_connections (daemon);
+
   if (MHD_NO == may_block)
     timeout = 0;
   else
@@ -4241,6 +4233,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,
@@ -4379,11 +4376,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))
@@ -4466,10 +4458,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]