commit 02f1f5e5cc70380f1e8a110d7bab9986a56f43e7
parent 534d586422c6eba94ae1b193338138cb2abce3cf
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 11 May 2017 22:29:11 +0300
resume_suspended_connections(): minor optimization
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2833,6 +2833,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
struct MHD_Connection *pos;
struct MHD_Connection *prev = NULL;
int ret;
+ const bool used_thr_p_c = (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION));
ret = MHD_NO;
MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
@@ -2870,7 +2871,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
DLL_insert (daemon->connections_head,
daemon->connections_tail,
pos);
- if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
+ if (!used_thr_p_c)
{
/* Reset timeout timer on resume. */
if (0 != pos->connection_timeout)
@@ -2916,7 +2917,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
pos->resuming = false;
}
MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
- if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
+ if ( (used_thr_p_c) &&
(MHD_NO != ret) )
{ /* Wake up suspended connections. */
if (! MHD_itc_activate_(daemon->itc,