libmicrohttpd

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

commit 32d7b92ba70509405f78b80711ef142391b63bd6
parent b99be60d5d4df406cefab8aa3c8f3b764bd1ba1a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 19 Jul 2013 08:05:35 +0000

-cleanup connections also if MHD_run_from_select is used

Diffstat:
MChangeLog | 2++
Msrc/microhttpd/daemon.c | 13+++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,4 +1,6 @@ Fri Jul 19 09:57:27 CEST 2013 + Fix issue where connections were not cleaned up when + 'MHD_run_from_select' was used. Releasing libmicrohttpd 0.9.28. -CG Sun Jul 14 19:57:56 CEST 2013 diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -1610,6 +1610,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon, pos->idle_handler (pos); } } + MHD_cleanup_connections (daemon); return MHD_YES; } @@ -2153,14 +2154,22 @@ MHD_run (struct MHD_Daemon *daemon) (0 != (daemon->options & MHD_USE_SELECT_INTERNALLY)) ) return MHD_NO; if (0 != (daemon->options & MHD_USE_POLL)) + { MHD_poll (daemon, MHD_NO); + MHD_cleanup_connections (daemon); + } #if EPOLL_SUPPORT else if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) + { MHD_epoll (daemon, MHD_NO); + MHD_cleanup_connections (daemon); + } #endif - else + else + { MHD_select (daemon, MHD_NO); - MHD_cleanup_connections (daemon); + /* MHD_select does MHD_cleanup_connections already */ + } return MHD_YES; }