commit ac82c4d331f864f2100db4c3ffce16a5c34042e7
parent 76500135fe570921bc86093bb84872e17f1fe1cb
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 16 Mar 2017 21:58:16 +0300
Improved thread-safe for MHD_set_connection_option()
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -3373,6 +3373,7 @@ MHD_set_connection_option (struct MHD_Connection *connection,
switch (option)
{
case MHD_CONNECTION_OPTION_TIMEOUT:
+ MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
(! connection->suspended) )
{
@@ -3401,6 +3402,7 @@ MHD_set_connection_option (struct MHD_Connection *connection,
daemon->manual_timeout_tail,
connection);
}
+ MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
return MHD_YES;
default:
return MHD_NO;