[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 04/05: Added asserts to check for non-master daemons onl
From: |
gnunet |
Subject: |
[libmicrohttpd] 04/05: Added asserts to check for non-master daemons only |
Date: |
Thu, 12 May 2022 15:42:22 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 1619fda1d7740f62bd121dc070fc093b9a282252
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu May 12 15:50:43 2022 +0300
Added asserts to check for non-master daemons only
---
src/microhttpd/connection.c | 4 ++++
src/microhttpd/daemon.c | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 4ca35e0d..ab659064 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3714,6 +3714,9 @@ void
MHD_update_last_activity_ (struct MHD_Connection *connection)
{
struct MHD_Daemon *daemon = connection->daemon;
+#if defined(MHD_USE_THREADS)
+ mhd_assert (NULL == daemon->worker_pool);
+#endif /* MHD_USE_THREADS */
if (0 == connection->connection_timeout_ms)
return; /* Skip update of activity for connections
@@ -4307,6 +4310,7 @@ cleanup_connection (struct MHD_Connection *connection)
#ifdef MHD_USE_THREADS
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
MHD_thread_ID_match_current_ (connection->pid) );
+ mhd_assert (NULL == daemon->worker_pool);
#endif /* MHD_USE_THREADS */
if (connection->in_cleanup)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index dd19a095..1b89de10 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2732,6 +2732,7 @@ new_connection_process_ (struct MHD_Daemon *daemon,
* must be called only within daemon thread. */
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
MHD_thread_ID_match_current_ (daemon->pid) );
+ mhd_assert (NULL == daemon->worker_pool);
#endif /* MHD_USE_THREADS */
/* Allocate memory pool in the processing thread so
@@ -3079,6 +3080,7 @@ void
internal_suspend_connection_ (struct MHD_Connection *connection)
{
struct MHD_Daemon *daemon = connection->daemon;
+ mhd_assert (NULL == daemon->worker_pool);
#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
@@ -3223,6 +3225,9 @@ _MHD_EXTERN void
MHD_resume_connection (struct MHD_Connection *connection)
{
struct MHD_Daemon *daemon = connection->daemon;
+#if defined(MHD_USE_THREADS)
+ mhd_assert (NULL == daemon->worker_pool);
+#endif /* MHD_USE_THREADS */
if (0 == (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
MHD_PANIC (_ (
@@ -3599,6 +3604,7 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
#ifdef MHD_USE_THREADS
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
MHD_thread_ID_match_current_ (daemon->pid) );
+ mhd_assert (NULL == daemon->worker_pool);
#endif /* MHD_USE_THREADS */
addrlen = sizeof (addrstorage);
@@ -3779,6 +3785,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
#if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
MHD_thread_ID_match_current_ (daemon->pid) );
+ mhd_assert (NULL == daemon->worker_pool);
MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
#endif
@@ -5497,6 +5504,7 @@ close_connection (struct MHD_Connection *pos)
#ifdef MHD_USE_THREADS
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
MHD_thread_ID_match_current_ (daemon->pid) );
+ mhd_assert (NULL == daemon->worker_pool);
#endif /* MHD_USE_THREADS */
if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.