gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (7764a946 -> 88374e04


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (7764a946 -> 88374e04)
Date: Thu, 16 Mar 2017 18:47:10 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 7764a946 Fixed thread-safety of MHD_get_daemon_info() for 
MHD_DAEMON_INFO_CURRENT_CONNECTIONS, Updated 
MHD_DAEMON_INFO_CURRENT_CONNECTIONS description
     new 5e099343 MHD_tls_connection_handle_idle(): do not need to explicitly 
handle data pending in TLS buffers Data from TLS buffers handled automatically 
by read/write functions.
     new 53ffa669 Do not disconnect suspended HTTPS connections by timeout.
     new 88374e04 Thread-safety: always lock mutex when modifying "cleanup" or 
"timeout" DL-lists

The 3 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                         | 7 +++++++
 src/microhttpd/connection.c       | 2 ++
 src/microhttpd/connection_https.c | 5 ++---
 src/microhttpd/daemon.c           | 5 +++++
 src/microhttpd/internal.h         | 3 ++-
 5 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7cca315c..882c9598 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Mar 16 20:35:59 MSK 2017
+       Improved thread-safety for DL-lists. -EG
+
+Thu Mar 16 17:55:01 MSK 2017
+       Fixed thread-safety of MHD_get_daemon_info() for
+       MHD_DAEMON_INFO_CURRENT_CONNECTIONS. -EG
+
 Thu Mar 16 16:49:07 MSK 2017
        Added ability to get actual daemon flags via MHD_get_daemon_info().
        Fixed test_upgrade to work in request mode.
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 74238a1b..7740e0e7 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2382,6 +2382,7 @@ update_last_activity (struct MHD_Connection *connection)
   if (connection->connection_timeout != daemon->connection_timeout)
     return; /* custom timeout, no need to move it in "normal" DLL */
 
+  MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
   /* move connection to head of timeout list (by remove + add operation) */
   XDLL_remove (daemon->normal_timeout_head,
               daemon->normal_timeout_tail,
@@ -2389,6 +2390,7 @@ update_last_activity (struct MHD_Connection *connection)
   XDLL_insert (daemon->normal_timeout_head,
               daemon->normal_timeout_tail,
               connection);
+  MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
 
 
diff --git a/src/microhttpd/connection_https.c 
b/src/microhttpd/connection_https.c
index dea9956d..d71a31c8 100644
--- a/src/microhttpd/connection_https.c
+++ b/src/microhttpd/connection_https.c
@@ -140,6 +140,8 @@ MHD_tls_connection_handle_idle (struct MHD_Connection 
*connection)
             __FUNCTION__,
             MHD_state_to_string (connection->state));
 #endif
+  if (connection->suspended)
+    return MHD_connection_handle_idle (connection);
   timeout = connection->connection_timeout;
   if ( (timeout != 0) &&
        (timeout <= (MHD_monotonic_sec_counter() - connection->last_activity)))
@@ -154,9 +156,6 @@ MHD_tls_connection_handle_idle (struct MHD_Connection 
*connection)
     case MHD_CONNECTION_CLOSED:
       return MHD_connection_handle_idle (connection);
     default:
-      if ( (0 != gnutls_record_check_pending (connection->tls_session)) &&
-          (MHD_YES != MHD_tls_connection_handle_read (connection)) )
-       return MHD_YES;
       return MHD_connection_handle_idle (connection);
     }
 #ifdef EPOLL_SUPPORT
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 001c3586..d3b02c27 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4403,6 +4403,9 @@ close_connection (struct MHD_Connection *pos)
     }
   MHD_connection_close_ (pos,
                          MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN);
+
+  MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
+
   if (pos->connection_timeout == pos->daemon->connection_timeout)
     XDLL_remove (daemon->normal_timeout_head,
                 daemon->normal_timeout_tail,
@@ -4417,6 +4420,8 @@ close_connection (struct MHD_Connection *pos)
   DLL_insert (daemon->cleanup_head,
              daemon->cleanup_tail,
              pos);
+
+  MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
 }
 
 
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index f9172372..44590878 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1373,7 +1373,8 @@ struct MHD_Daemon
   MHD_mutex_ per_ip_connection_mutex;
 
   /**
-   * Mutex for (modifying) access to the "cleanup" connection DLL.
+   * Mutex for (modifying) access to the "cleanup", "normal_timeout" and
+   * "manual_timeout" DLLs.
    */
   MHD_mutex_ cleanup_connection_mutex;
 

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



reply via email to

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