libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit dd327c1d13252373cd1730e445d19930417571bf
parent fd0ceb70580e4fc7096720e123a25970b69631d9
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu, 27 Oct 2016 22:43:48 +0300

Skip locking when not required

Diffstat:
Msrc/microhttpd/daemon.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -2472,10 +2472,10 @@ resume_suspended_connections (struct MHD_Daemon *daemon) int ret; ret = MHD_NO; + if (MHD_NO == daemon->resuming) + return ret; if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex); - if (MHD_NO != daemon->resuming) - next = daemon->suspended_connections_head; /* Clear the flag *only* if connections will be resumed otherwise it may accidentally clear flag that was set at the same time in