aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd')
-rw-r--r--src/microhttpd/connection.c2
-rw-r--r--src/microhttpd/daemon.c5
-rw-r--r--src/microhttpd/internal.h3
3 files changed, 9 insertions, 1 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 74238a1b..7740e0e7 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2382,6 +2382,7 @@ update_last_activity (struct MHD_Connection *connection)
2382 if (connection->connection_timeout != daemon->connection_timeout) 2382 if (connection->connection_timeout != daemon->connection_timeout)
2383 return; /* custom timeout, no need to move it in "normal" DLL */ 2383 return; /* custom timeout, no need to move it in "normal" DLL */
2384 2384
2385 MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
2385 /* move connection to head of timeout list (by remove + add operation) */ 2386 /* move connection to head of timeout list (by remove + add operation) */
2386 XDLL_remove (daemon->normal_timeout_head, 2387 XDLL_remove (daemon->normal_timeout_head,
2387 daemon->normal_timeout_tail, 2388 daemon->normal_timeout_tail,
@@ -2389,6 +2390,7 @@ update_last_activity (struct MHD_Connection *connection)
2389 XDLL_insert (daemon->normal_timeout_head, 2390 XDLL_insert (daemon->normal_timeout_head,
2390 daemon->normal_timeout_tail, 2391 daemon->normal_timeout_tail,
2391 connection); 2392 connection);
2393 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
2392} 2394}
2393 2395
2394 2396
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 001c3586..d3b02c27 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4403,6 +4403,9 @@ close_connection (struct MHD_Connection *pos)
4403 } 4403 }
4404 MHD_connection_close_ (pos, 4404 MHD_connection_close_ (pos,
4405 MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN); 4405 MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN);
4406
4407 MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
4408
4406 if (pos->connection_timeout == pos->daemon->connection_timeout) 4409 if (pos->connection_timeout == pos->daemon->connection_timeout)
4407 XDLL_remove (daemon->normal_timeout_head, 4410 XDLL_remove (daemon->normal_timeout_head,
4408 daemon->normal_timeout_tail, 4411 daemon->normal_timeout_tail,
@@ -4417,6 +4420,8 @@ close_connection (struct MHD_Connection *pos)
4417 DLL_insert (daemon->cleanup_head, 4420 DLL_insert (daemon->cleanup_head,
4418 daemon->cleanup_tail, 4421 daemon->cleanup_tail,
4419 pos); 4422 pos);
4423
4424 MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex);
4420} 4425}
4421 4426
4422 4427
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index f9172372..44590878 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1373,7 +1373,8 @@ struct MHD_Daemon
1373 MHD_mutex_ per_ip_connection_mutex; 1373 MHD_mutex_ per_ip_connection_mutex;
1374 1374
1375 /** 1375 /**
1376 * Mutex for (modifying) access to the "cleanup" connection DLL. 1376 * Mutex for (modifying) access to the "cleanup", "normal_timeout" and
1377 * "manual_timeout" DLLs.
1377 */ 1378 */
1378 MHD_mutex_ cleanup_connection_mutex; 1379 MHD_mutex_ cleanup_connection_mutex;
1379 1380