diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-04-04 16:30:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-04-04 16:30:00 +0000 |
commit | 334974b4b18840b88c3332ba68863f6c9394b46d (patch) | |
tree | c64960ee38ba14bc0eafe48d126718444a4193cf | |
parent | 6d68b2d3af8881af035259d24d80aabe6bf93c22 (diff) | |
download | libmicrohttpd-334974b4b18840b88c3332ba68863f6c9394b46d.tar.gz libmicrohttpd-334974b4b18840b88c3332ba68863f6c9394b46d.zip |
fix multi-threaded shutdown deadlock issue
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/include/microhttpd.h | 4 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 2 | ||||
-rw-r--r-- | src/testcurl/test_concurrent_stop.c | 2 |
4 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,7 @@ | |||
1 | Sat Apr 4 18:28:24 CEST 2015 | ||
2 | Fix potential deadlock issue in MHD_USE_THREAD_PER_CONNECTION | ||
3 | mode if shutdown is initiated while connections are active. -CG | ||
4 | |||
1 | Sat Apr 4 17:48:13 CEST 2015 | 5 | Sat Apr 4 17:48:13 CEST 2015 |
2 | Fix issue in thread-pool mode where a MHD_stop_daemon() | 6 | Fix issue in thread-pool mode where a MHD_stop_daemon() |
3 | might not reach threads that stopped listening because | 7 | might not reach threads that stopped listening because |
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index a7e67df3..12e447c5 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -130,7 +130,7 @@ typedef intptr_t ssize_t; | |||
130 | * Current version of the library. | 130 | * Current version of the library. |
131 | * 0x01093001 = 1.9.30-1. | 131 | * 0x01093001 = 1.9.30-1. |
132 | */ | 132 | */ |
133 | #define MHD_VERSION 0x00093906 | 133 | #define MHD_VERSION 0x00093907 |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * MHD-internal return code for "YES". | 136 | * MHD-internal return code for "YES". |
@@ -2643,7 +2643,7 @@ enum MHD_FEATURE | |||
2643 | 2643 | ||
2644 | /** | 2644 | /** |
2645 | * Get whether password encrypted private key for HTTPS daemon is | 2645 | * Get whether password encrypted private key for HTTPS daemon is |
2646 | * supported. If supported then option | 2646 | * supported. If supported then option |
2647 | * ::MHD_OPTION_HTTPS_KEY_PASSWORD can be used. | 2647 | * ::MHD_OPTION_HTTPS_KEY_PASSWORD can be used. |
2648 | */ | 2648 | */ |
2649 | MHD_FEATURE_HTTPS_KEY_PASSWORD = 14 | 2649 | MHD_FEATURE_HTTPS_KEY_PASSWORD = 14 |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 01a5b6d4..bd952ce3 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -4213,6 +4213,8 @@ close_connection (struct MHD_Connection *pos) | |||
4213 | 4213 | ||
4214 | MHD_connection_close (pos, | 4214 | MHD_connection_close (pos, |
4215 | MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN); | 4215 | MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN); |
4216 | if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) | ||
4217 | return; /* must let thread to the rest */ | ||
4216 | if (pos->connection_timeout == pos->daemon->connection_timeout) | 4218 | if (pos->connection_timeout == pos->daemon->connection_timeout) |
4217 | XDLL_remove (daemon->normal_timeout_head, | 4219 | XDLL_remove (daemon->normal_timeout_head, |
4218 | daemon->normal_timeout_tail, | 4220 | daemon->normal_timeout_tail, |
diff --git a/src/testcurl/test_concurrent_stop.c b/src/testcurl/test_concurrent_stop.c index 4be64276..8ce16560 100644 --- a/src/testcurl/test_concurrent_stop.c +++ b/src/testcurl/test_concurrent_stop.c | |||
@@ -217,7 +217,7 @@ main (int argc, char *const *argv) | |||
217 | response = MHD_create_response_from_buffer (strlen ("/hello_world"), | 217 | response = MHD_create_response_from_buffer (strlen ("/hello_world"), |
218 | "/hello_world", | 218 | "/hello_world", |
219 | MHD_RESPMEM_MUST_COPY); | 219 | MHD_RESPMEM_MUST_COPY); |
220 | // errorCount += testMultithreadedGet (port++, 0); | 220 | errorCount += testMultithreadedGet (port++, 0); |
221 | errorCount += testMultithreadedPoolGet (port++, 0); | 221 | errorCount += testMultithreadedPoolGet (port++, 0); |
222 | MHD_destroy_response (response); | 222 | MHD_destroy_response (response); |
223 | if (errorCount != 0) | 223 | if (errorCount != 0) |