libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit f6b5ec5869da147ab6c107cd616195f0b9c2c6c8
parent 6fde86c265e3beaf1a29a511ed4fafbec5fbd06a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 21 Nov 2023 15:41:56 +0300

Improved daemon shutdown handling in external polling mode

Diffstat:
Msrc/microhttpd/daemon.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -992,7 +992,7 @@ internal_get_fdset2 (struct MHD_Daemon *daemon, MHD_socket ls; if (daemon->shutdown) - return MHD_NO; + return MHD_YES; ls = daemon->listen_fd; if ( (MHD_INVALID_SOCKET != ls) && @@ -1204,7 +1204,7 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon, if (MHD_D_IS_USING_EPOLL_ (daemon)) { if (daemon->shutdown) - return MHD_NO; + return MHD_YES; /* we're in epoll mode, use the epoll FD as a stand-in for the entire event set */ @@ -4208,7 +4208,8 @@ MHD_get_timeout64 (struct MHD_Daemon *daemon, if (daemon->data_already_pending || (NULL != daemon->cleanup_head) || daemon->resuming - || daemon->have_new) + || daemon->have_new + || daemon->shutdown) { /* Some data or connection statuses already waiting to be processed. */ *timeout64 = 0;