diff options
Diffstat (limited to 'src/daemon/daemon.c')
-rw-r--r-- | src/daemon/daemon.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c index 0fa51260..71d069ec 100644 --- a/src/daemon/daemon.c +++ b/src/daemon/daemon.c | |||
@@ -1073,10 +1073,23 @@ MHD_add_connection (struct MHD_Daemon *daemon, | |||
1073 | return MHD_NO; | 1073 | return MHD_NO; |
1074 | } | 1074 | } |
1075 | } | 1075 | } |
1076 | /* FIXME: race with removal operation! */ | 1076 | if (0 != pthread_mutex_lock(&daemon->cleanup_connection_mutex)) |
1077 | { | ||
1078 | #if HAVE_MESSAGES | ||
1079 | MHD_DLOG (daemon, "Failed to acquire cleanup mutex\n"); | ||
1080 | #endif | ||
1081 | abort(); | ||
1082 | } | ||
1077 | DLL_insert (daemon->connections_head, | 1083 | DLL_insert (daemon->connections_head, |
1078 | daemon->connections_tail, | 1084 | daemon->connections_tail, |
1079 | connection); | 1085 | connection); |
1086 | if (0 != pthread_mutex_unlock(&daemon->cleanup_connection_mutex)) | ||
1087 | { | ||
1088 | #if HAVE_MESSAGES | ||
1089 | MHD_DLOG (daemon, "Failed to release cleanup mutex\n"); | ||
1090 | #endif | ||
1091 | abort(); | ||
1092 | } | ||
1080 | daemon->max_connections--; | 1093 | daemon->max_connections--; |
1081 | return MHD_YES; | 1094 | return MHD_YES; |
1082 | } | 1095 | } |