diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-07-19 08:05:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-07-19 08:05:35 +0000 |
commit | 32d7b92ba70509405f78b80711ef142391b63bd6 (patch) | |
tree | 35dfb641be5c2dc07c508dcb48a53a3154ced57d | |
parent | b99be60d5d4df406cefab8aa3c8f3b764bd1ba1a (diff) | |
download | libmicrohttpd-32d7b92ba70509405f78b80711ef142391b63bd6.tar.gz libmicrohttpd-32d7b92ba70509405f78b80711ef142391b63bd6.zip |
-cleanup connections also if MHD_run_from_select is used
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 13 |
2 files changed, 13 insertions, 2 deletions
@@ -1,4 +1,6 @@ | |||
1 | Fri Jul 19 09:57:27 CEST 2013 | 1 | Fri Jul 19 09:57:27 CEST 2013 |
2 | Fix issue where connections were not cleaned up when | ||
3 | 'MHD_run_from_select' was used. | ||
2 | Releasing libmicrohttpd 0.9.28. -CG | 4 | Releasing libmicrohttpd 0.9.28. -CG |
3 | 5 | ||
4 | Sun Jul 14 19:57:56 CEST 2013 | 6 | Sun Jul 14 19:57:56 CEST 2013 |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 965f9985..1625078d 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -1610,6 +1610,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon, | |||
1610 | pos->idle_handler (pos); | 1610 | pos->idle_handler (pos); |
1611 | } | 1611 | } |
1612 | } | 1612 | } |
1613 | MHD_cleanup_connections (daemon); | ||
1613 | return MHD_YES; | 1614 | return MHD_YES; |
1614 | } | 1615 | } |
1615 | 1616 | ||
@@ -2153,14 +2154,22 @@ MHD_run (struct MHD_Daemon *daemon) | |||
2153 | (0 != (daemon->options & MHD_USE_SELECT_INTERNALLY)) ) | 2154 | (0 != (daemon->options & MHD_USE_SELECT_INTERNALLY)) ) |
2154 | return MHD_NO; | 2155 | return MHD_NO; |
2155 | if (0 != (daemon->options & MHD_USE_POLL)) | 2156 | if (0 != (daemon->options & MHD_USE_POLL)) |
2157 | { | ||
2156 | MHD_poll (daemon, MHD_NO); | 2158 | MHD_poll (daemon, MHD_NO); |
2159 | MHD_cleanup_connections (daemon); | ||
2160 | } | ||
2157 | #if EPOLL_SUPPORT | 2161 | #if EPOLL_SUPPORT |
2158 | else if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) | 2162 | else if (0 != (daemon->options & MHD_USE_EPOLL_LINUX_ONLY)) |
2163 | { | ||
2159 | MHD_epoll (daemon, MHD_NO); | 2164 | MHD_epoll (daemon, MHD_NO); |
2165 | MHD_cleanup_connections (daemon); | ||
2166 | } | ||
2160 | #endif | 2167 | #endif |
2161 | else | 2168 | else |
2169 | { | ||
2162 | MHD_select (daemon, MHD_NO); | 2170 | MHD_select (daemon, MHD_NO); |
2163 | MHD_cleanup_connections (daemon); | 2171 | /* MHD_select does MHD_cleanup_connections already */ |
2172 | } | ||
2164 | return MHD_YES; | 2173 | return MHD_YES; |
2165 | } | 2174 | } |
2166 | 2175 | ||