diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-10-20 10:27:27 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-10-20 22:05:32 +0300 |
commit | ccd676036751f15a8a7558640660620848b40d6b (patch) | |
tree | 5e81ef42deed4d7c32a34d015f66c4254ea92e92 | |
parent | 1777068bd81603228f0c7e3e20005769aeba838e (diff) | |
download | libmicrohttpd-ccd676036751f15a8a7558640660620848b40d6b.tar.gz libmicrohttpd-ccd676036751f15a8a7558640660620848b40d6b.zip |
MHD_add_connection(): do not cleanup if not safe
-rw-r--r-- | src/microhttpd/daemon.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 2eefdef5..d966ece5 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -3209,7 +3209,11 @@ MHD_add_connection (struct MHD_Daemon *daemon, | |||
3209 | { | 3209 | { |
3210 | bool sk_nonbl; | 3210 | bool sk_nonbl; |
3211 | 3211 | ||
3212 | MHD_cleanup_connections (daemon); | 3212 | /* NOT thread safe with internal thread. TODO: fix thread safety. */ |
3213 | if ((0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) && | ||
3214 | (daemon->connection_limit <= daemon->connections)) | ||
3215 | MHD_cleanup_connections (daemon); | ||
3216 | |||
3213 | if (! MHD_socket_nonblocking_ (client_socket)) | 3217 | if (! MHD_socket_nonblocking_ (client_socket)) |
3214 | { | 3218 | { |
3215 | #ifdef HAVE_MESSAGES | 3219 | #ifdef HAVE_MESSAGES |