gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (c13d2767 -> 0ecf4f26


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (c13d2767 -> 0ecf4f26)
Date: Sun, 21 May 2017 17:56:11 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from c13d2767 Fixed missing mutex unlock in 
7d3050325e3b77a061b40ea9ce77a360d14b4dea
     new 5060c37b Removed leftover comment
     new a3519410 MHD_get_connection_info(): fixed returned 'bool' which is not 
a member of union MHD_ConnectionInfo
     new 3a0f1ddb close_connection(): added two EXTRA_CHECKs
     new a7b6407c cleanup_connection(): fixed cleanup of suspended connection
     new 0ecf4f26 resume_suspended_connections(): do not update connection 
state during resuming,  handle update of states in main loop as handling of 
locking can significantly increase  complexity of processing in 
resume_suspended_connections(). This revert 
16da279752e54c616edcb485ea637234101447c9, but resumed connections in epoll  
mode are processed already faster after 
534d586422c6eba94ae1b193338138cb2abce3cf.

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                   | 10 ++++++++++
 src/microhttpd/connection.c | 27 +++++++++++++--------------
 src/microhttpd/daemon.c     |  5 ++---
 src/microhttpd/internal.h   |  5 +++++
 4 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aabf1b9e..1b18ab49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Sun May 21 18:48:00 MSK 2017
+       Fixed build with disabled "UPGRADE".
+       Fixed possible null-dereference in HTTPS test.
+       Fixed compiler warning in process_request_body(), minor optimizations.
+       Do not allow suspend of "upgraded" connections.
+       Fixed returned value for MHD_CONNECTION_INFO_CONNECTION_SUSPENDED.
+       Fixed removal from timeout lists of non-existing connections in
+       cleanup_connection().
+       Fixed double locking of mutex. -EG
+
 Sun May 14 15:05:00 MSK 2017
        Fixed resuming connections and closing upgraded connections in select()
        mode with thread-per-connection. -EG
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index cee82945..2db85685 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1526,8 +1526,6 @@ MHD_connection_update_event_loop_info (struct 
MHD_Connection *connection)
                      on the connection (if a timeout is even
                      set!).
                      Solution: we kill the connection with an error */
-                  /* If connection is suspended, give application one
-                   * more chance to read data once connection is resumed. */
                   transmit_error_response (connection,
                                            MHD_HTTP_INTERNAL_SERVER_ERROR,
                                            INTERNAL_ERROR);
@@ -2836,17 +2834,6 @@ cleanup_connection (struct MHD_Connection *connection)
       connection->response = NULL;
     }
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
-  if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
-    {
-      if (connection->connection_timeout == daemon->connection_timeout)
-        XDLL_remove (daemon->normal_timeout_head,
-                     daemon->normal_timeout_tail,
-                     connection);
-      else
-        XDLL_remove (daemon->manual_timeout_head,
-                     daemon->manual_timeout_tail,
-                     connection);
-    }
   if (connection->suspended)
     {
       DLL_remove (daemon->suspended_connections_head,
@@ -2856,6 +2843,17 @@ cleanup_connection (struct MHD_Connection *connection)
     }
   else
     {
+      if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+        {
+          if (connection->connection_timeout == daemon->connection_timeout)
+            XDLL_remove (daemon->normal_timeout_head,
+                         daemon->normal_timeout_tail,
+                         connection);
+          else
+            XDLL_remove (daemon->manual_timeout_head,
+                         daemon->manual_timeout_tail,
+                         connection);
+        }
       DLL_remove (daemon->connections_head,
                   daemon->connections_tail,
                   connection);
@@ -3488,7 +3486,8 @@ MHD_get_connection_info (struct MHD_Connection 
*connection,
     case MHD_CONNECTION_INFO_SOCKET_CONTEXT:
       return (const union MHD_ConnectionInfo *) &connection->socket_context;
     case MHD_CONNECTION_INFO_CONNECTION_SUSPENDED:
-      return (const union MHD_ConnectionInfo *) &connection->suspended;
+      connection->suspended_dummy = connection->suspended ? MHD_YES : MHD_NO;
+      return (const union MHD_ConnectionInfo *) &connection->suspended_dummy;
     case MHD_CONNECTION_INFO_CONNECTION_TIMEOUT:
       connection->connection_timeout_dummy = (unsigned 
int)connection->connection_timeout;
       return (const union MHD_ConnectionInfo *) 
&connection->connection_timeout_dummy;
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 8f6b978f..9aa18b37 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2914,9 +2914,6 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
               pos->epoll_state &= ~MHD_EPOLL_STATE_SUSPENDED;
             }
 #endif
-          /* Process response queued during suspend and update states. */
-          if (!used_thr_p_c)
-            MHD_connection_handle_idle (pos);
         }
 #ifdef UPGRADE_SUPPORT
       else
@@ -4513,6 +4510,8 @@ close_connection (struct MHD_Connection *pos)
 
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
 
+  EXTRA_CHECK (! pos->suspended);
+  EXTRA_CHECK (! pos->resuming);
   if (pos->connection_timeout == pos->daemon->connection_timeout)
     XDLL_remove (daemon->normal_timeout_head,
                 daemon->normal_timeout_tail,
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index ac8f7330..ac7531f1 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -996,6 +996,11 @@ struct MHD_Connection
   bool suspended;
 
   /**
+   * Special member to be returned by #MHD_get_connection_info()
+   */
+  int suspended_dummy;
+
+  /**
    * Is the connection wanting to resume?
    */
   bool resuming;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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