[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated: daemon.c: process new connections
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated: daemon.c: process new connections in more efficient way |
Date: |
Sun, 25 Oct 2020 20:41:26 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new 01fec590 daemon.c: process new connections in more efficient way
01fec590 is described below
commit 01fec59041241ccc8510790c929094262ba8454c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 25 22:33:41 2020 +0300
daemon.c: process new connections in more efficient way
---
src/microhttpd/daemon.c | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index c0be6bc0..03649adf 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2925,33 +2925,25 @@ new_connections_list_process_ (struct MHD_Daemon
*daemon)
{
struct MHD_Connection *local_head;
struct MHD_Connection *local_tail;
- struct MHD_Connection *c; /**< Currently processed connection */
mhd_assert (daemon->have_new);
mhd_assert (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD));
- local_head = NULL;
- local_tail = NULL;
-
- /* Move all new connections to the local DL-list to release the mutex
- * as quick as possible. */
+ /* Detach DL-list of new connections from the daemon for
+ * following local processing. */
MHD_mutex_lock_chk_ (&daemon->new_connections_mutex);
mhd_assert (NULL != daemon->new_connections_head);
- do
- { /* Move connection in FIFO order. */
- c = daemon->new_connections_tail;
- DLL_remove (daemon->new_connections_head,
- daemon->new_connections_tail,
- c);
- DLL_insert (local_head,
- local_tail,
- c);
- } while (NULL != daemon->new_connections_tail);
+ local_head = daemon->new_connections_head;
+ local_tail = daemon->new_connections_tail;
+ daemon->new_connections_head = NULL;
+ daemon->new_connections_tail = NULL;
daemon->have_new = false;
MHD_mutex_unlock_chk_ (&daemon->new_connections_mutex);
/* Process new connections in FIFO order. */
do
{
+ struct MHD_Connection *c; /**< Currently processed connection */
+
c = local_tail;
DLL_remove (local_head,
local_tail,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libmicrohttpd] branch master updated: daemon.c: process new connections in more efficient way,
gnunet <=