diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-26 19:07:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-26 19:07:19 +0000 |
commit | ed9dfcdad4b3328342b2c8cc3fda29b18abe9ce9 (patch) | |
tree | 33d4dff7a4be5465ad7f88729bb6de3e35e20d16 | |
parent | 280d6c473fd2f0cbab831b633b827a506678c87a (diff) | |
download | libmicrohttpd-ed9dfcdad4b3328342b2c8cc3fda29b18abe9ce9.tar.gz libmicrohttpd-ed9dfcdad4b3328342b2c8cc3fda29b18abe9ce9.zip |
fix failure to terminate quickly in thread-per-connection mode if clients have open connections
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/include/microhttpd.h | 2 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 2 |
3 files changed, 7 insertions, 2 deletions
@@ -1,3 +1,8 @@ | |||
1 | Thu Jun 26 21:06:04 CEST 2014 | ||
2 | Fix failure to terminate 'instantly' in thread-per-connection | ||
3 | mode if there is a client with open connections. | ||
4 | Thanks to Kenneth Mastro for reporting. -CG | ||
5 | |||
1 | Sun Jun 22 12:22:08 CEST 2014 | 6 | Sun Jun 22 12:22:08 CEST 2014 |
2 | Actually, avoid locking on response as responses must | 7 | Actually, avoid locking on response as responses must |
3 | not be modified in a connection-specific way; instead | 8 | not be modified in a connection-specific way; instead |
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 34c6da1f..97cde58b 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 0x00093703 | 133 | #define MHD_VERSION 0x00093704 |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * MHD-internal return code for "YES". | 136 | * MHD-internal return code for "YES". |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 0fdd32eb..8f15498c 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -3996,7 +3996,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
3996 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && | 3996 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && |
3997 | (MHD_YES != MHD_mutex_lock_ (&daemon->cleanup_connection_mutex)) ) | 3997 | (MHD_YES != MHD_mutex_lock_ (&daemon->cleanup_connection_mutex)) ) |
3998 | MHD_PANIC ("Failed to acquire cleanup mutex\n"); | 3998 | MHD_PANIC ("Failed to acquire cleanup mutex\n"); |
3999 | for (pos = daemon->connections_head; NULL != pos; pos = pos->nextX) | 3999 | for (pos = daemon->connections_head; NULL != pos; pos = pos->next) |
4000 | shutdown (pos->socket_fd, | 4000 | shutdown (pos->socket_fd, |
4001 | (pos->read_closed == MHD_YES) ? SHUT_WR : SHUT_RDWR); | 4001 | (pos->read_closed == MHD_YES) ? SHUT_WR : SHUT_RDWR); |
4002 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && | 4002 | if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && |