diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-01-06 20:41:58 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-01-06 20:42:59 +0100 |
commit | b16912401788773e4f608f107621902100b85515 (patch) | |
tree | 6f38b692b46cb58cc163db2ff1e2ed49a8adb1b4 | |
parent | df6124f7a892830649823e41d7f27147f8817066 (diff) | |
download | libmicrohttpd-b16912401788773e4f608f107621902100b85515.tar.gz libmicrohttpd-b16912401788773e4f608f107621902100b85515.zip |
return timeout of 0 if cleanup is pending
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/include/microhttpd.h | 8 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 5 |
3 files changed, 10 insertions, 8 deletions
@@ -1,3 +1,6 @@ | |||
1 | Wed 06 Jan 2021 08:39:58 PM CET | ||
2 | Return timeout of zero also for connections awaiting cleanup. -CG | ||
3 | |||
1 | Mon 28 Dec 2020 21:36:00 MSK | 4 | Mon 28 Dec 2020 21:36:00 MSK |
2 | Releasing libmicrohttpd 0.9.72. -EG | 5 | Releasing libmicrohttpd 0.9.72. -EG |
3 | 6 | ||
@@ -26,7 +29,7 @@ Sun 01 Nov 2020 17:17:00 MSK | |||
26 | Minor improvements of error reporting in MHD daemon. | 29 | Minor improvements of error reporting in MHD daemon. |
27 | Fixed FTBFS with GnuTLS versions before 3.1.9 | 30 | Fixed FTBFS with GnuTLS versions before 3.1.9 |
28 | Fixed test_add_conn for multi-CPU machines. | 31 | Fixed test_add_conn for multi-CPU machines. |
29 | Fixed analyzer warnings. | 32 | Fixed analyzer warnings. |
30 | Fixed use-after-free and resources leaks for upgraded connections | 33 | Fixed use-after-free and resources leaks for upgraded connections |
31 | in TLS mode with thread-per-connection. -EG | 34 | in TLS mode with thread-per-connection. -EG |
32 | 35 | ||
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index 9dc83fb3..2f76a1ec 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -133,7 +133,7 @@ typedef intptr_t ssize_t; | |||
133 | * @note While it is a hexadecimal number, it is parsed as decimal number. | 133 | * @note While it is a hexadecimal number, it is parsed as decimal number. |
134 | * Example: 0x01093001 = 1.9.30-1. | 134 | * Example: 0x01093001 = 1.9.30-1. |
135 | */ | 135 | */ |
136 | #define MHD_VERSION 0x00097201 | 136 | #define MHD_VERSION 0x00097202 |
137 | 137 | ||
138 | /** | 138 | /** |
139 | * Operational results from MHD calls. | 139 | * Operational results from MHD calls. |
@@ -222,12 +222,12 @@ typedef SOCKET MHD_socket; | |||
222 | #define _MHD_INSTRMACRO(a) #a | 222 | #define _MHD_INSTRMACRO(a) #a |
223 | #define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a) | 223 | #define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a) |
224 | /* deprecation message */ | 224 | /* deprecation message */ |
225 | #define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \ | 225 | #define _MHD_DEPR_MACRO(msg) __pragma(message (__FILE__ "(" _MHD_STRMACRO ( \ |
226 | __LINE__) "): warning: " msg)) | 226 | __LINE__) "): warning: " msg)) |
227 | #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg) | 227 | #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg) |
228 | #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) | 228 | #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) |
229 | /* clang or GCC since 3.0 */ | 229 | /* clang or GCC since 3.0 */ |
230 | #define _MHD_GCC_PRAG(x) _Pragma (#x) | 230 | #define _MHD_GCC_PRAG(x) _Pragma(#x) |
231 | #if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \ | 231 | #if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \ |
232 | (! defined(__apple_build_version__) && \ | 232 | (! defined(__apple_build_version__) && \ |
233 | (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \ | 233 | (__clang_major__ + 0 > 3 || (__clang_major__ + 0 == 3 && __clang_minor__ >= \ |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 021f1d6f..cae031bd 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -3275,7 +3275,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon) | |||
3275 | DLL_insert (daemon->cleanup_head, | 3275 | DLL_insert (daemon->cleanup_head, |
3276 | daemon->cleanup_tail, | 3276 | daemon->cleanup_tail, |
3277 | pos); | 3277 | pos); |
3278 | 3278 | daemon->data_already_pending = true; | |
3279 | } | 3279 | } |
3280 | #endif /* UPGRADE_SUPPORT */ | 3280 | #endif /* UPGRADE_SUPPORT */ |
3281 | pos->resuming = false; | 3281 | pos->resuming = false; |
@@ -3770,14 +3770,12 @@ MHD_get_timeout (struct MHD_Daemon *daemon, | |||
3770 | #endif | 3770 | #endif |
3771 | return MHD_NO; | 3771 | return MHD_NO; |
3772 | } | 3772 | } |
3773 | |||
3774 | if (daemon->data_already_pending) | 3773 | if (daemon->data_already_pending) |
3775 | { | 3774 | { |
3776 | /* Some data already waiting to be processed. */ | 3775 | /* Some data already waiting to be processed. */ |
3777 | *timeout = 0; | 3776 | *timeout = 0; |
3778 | return MHD_YES; | 3777 | return MHD_YES; |
3779 | } | 3778 | } |
3780 | |||
3781 | #ifdef EPOLL_SUPPORT | 3779 | #ifdef EPOLL_SUPPORT |
3782 | if ( (0 != (daemon->options & MHD_USE_EPOLL)) && | 3780 | if ( (0 != (daemon->options & MHD_USE_EPOLL)) && |
3783 | ((NULL != daemon->eready_head) | 3781 | ((NULL != daemon->eready_head) |
@@ -5090,6 +5088,7 @@ close_connection (struct MHD_Connection *pos) | |||
5090 | DLL_insert (daemon->cleanup_head, | 5088 | DLL_insert (daemon->cleanup_head, |
5091 | daemon->cleanup_tail, | 5089 | daemon->cleanup_tail, |
5092 | pos); | 5090 | pos); |
5091 | daemon->data_already_pending = true; | ||
5093 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | 5092 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) |
5094 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); | 5093 | MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); |
5095 | #endif | 5094 | #endif |