commit e35469ec9bec0b30e8dda99ad458175fe8ecdbf6 parent cd4d2f65fc1d75e83a1a6caed9c9391d4e7b1773 Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Fri, 27 Oct 2023 11:14:18 +0300 Added detection of more conditions to process the data without waiting If no new or current connections are pending to be processed, it is a good moment to perform some internal maintenance, like cleanup Diffstat:
| M | src/microhttpd/daemon.c | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -4205,9 +4205,12 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, #endif return MHD_NO; } - if (daemon->data_already_pending) + if (daemon->data_already_pending + || (NULL != daemon->cleanup_head) + || daemon->resuming + || daemon->have_new) { - /* Some data already waiting to be processed. */ + /* Some data or connection statuses already waiting to be processed. */ *timeout64 = 0; return MHD_YES; }