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) |
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 @@ +Wed 06 Jan 2021 08:39:58 PM CET + Return timeout of zero also for connections awaiting cleanup. -CG + Mon 28 Dec 2020 21:36:00 MSK Releasing libmicrohttpd 0.9.72. -EG @@ -26,7 +29,7 @@ Sun 01 Nov 2020 17:17:00 MSK Minor improvements of error reporting in MHD daemon. Fixed FTBFS with GnuTLS versions before 3.1.9 Fixed test_add_conn for multi-CPU machines. - Fixed analyzer warnings. + Fixed analyzer warnings. Fixed use-after-free and resources leaks for upgraded connections in TLS mode with thread-per-connection. -EG 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; * @note While it is a hexadecimal number, it is parsed as decimal number. * Example: 0x01093001 = 1.9.30-1. */ -#define MHD_VERSION 0x00097201 +#define MHD_VERSION 0x00097202 /** * Operational results from MHD calls. @@ -222,12 +222,12 @@ typedef SOCKET MHD_socket; #define _MHD_INSTRMACRO(a) #a #define _MHD_STRMACRO(a) _MHD_INSTRMACRO (a) /* deprecation message */ -#define _MHD_DEPR_MACRO(msg) __pragma (message (__FILE__ "(" _MHD_STRMACRO ( \ - __LINE__) "): warning: " msg)) +#define _MHD_DEPR_MACRO(msg) __pragma(message (__FILE__ "(" _MHD_STRMACRO ( \ + __LINE__) "): warning: " msg)) #define _MHD_DEPR_IN_MACRO(msg) _MHD_DEPR_MACRO (msg) #elif defined(__clang__) || defined (__GNUC_PATCHLEVEL__) /* clang or GCC since 3.0 */ -#define _MHD_GCC_PRAG(x) _Pragma (#x) +#define _MHD_GCC_PRAG(x) _Pragma(#x) #if (defined(__clang__) && (__clang_major__ + 0 >= 5 || \ (! defined(__apple_build_version__) && \ (__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) DLL_insert (daemon->cleanup_head, daemon->cleanup_tail, pos); - + daemon->data_already_pending = true; } #endif /* UPGRADE_SUPPORT */ pos->resuming = false; @@ -3770,14 +3770,12 @@ MHD_get_timeout (struct MHD_Daemon *daemon, #endif return MHD_NO; } - if (daemon->data_already_pending) { /* Some data already waiting to be processed. */ *timeout = 0; return MHD_YES; } - #ifdef EPOLL_SUPPORT if ( (0 != (daemon->options & MHD_USE_EPOLL)) && ((NULL != daemon->eready_head) @@ -5090,6 +5088,7 @@ close_connection (struct MHD_Connection *pos) DLL_insert (daemon->cleanup_head, daemon->cleanup_tail, pos); + daemon->data_already_pending = true; #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) MHD_mutex_unlock_chk_ (&daemon->cleanup_connection_mutex); #endif |