libmicrohttpd

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

commit e82e13bba5f93be46f4870a0bb32e4367d7d4021
parent d7a7a47de56eebd2d1bd31fa74240dfda9929649
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  9 Dec 2013 20:43:13 +0000

fixing #3179

Diffstat:
MChangeLog | 5+++++
Msrc/include/microhttpd.h | 2+-
Msrc/microhttpd/daemon.c | 10++++++++++
3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +Mon Dec 9 21:41:57 CET 2013 + Fix for per-worker daemon pipes enabled with + MHD_USE_SUSPEND_RESUME that were not closed in + MHD_stop_daemon. -MH + Sat Dec 7 00:44:49 CET 2013 Fixing warnings and build issue if --disable-https is given to configure. -CG diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -121,7 +121,7 @@ extern "C" * Current version of the library. * 0x01093001 = 1.9.30-1. */ -#define MHD_VERSION 0x00093201 +#define MHD_VERSION 0x00093202 /** * MHD-internal return code for "YES". diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -3978,6 +3978,16 @@ MHD_stop_daemon (struct MHD_Daemon *daemon) (0 != CLOSE (daemon->worker_pool[i].epoll_fd)) ) MHD_PANIC ("close failed\n"); #endif + if ( (MHD_USE_SUSPEND_RESUME == (daemon->options & MHD_USE_SUSPEND_RESUME)) ) + { + if (-1 != daemon->worker_pool[i].wpipe[1]) + { + if (0 != CLOSE (daemon->worker_pool[i].wpipe[0])) + MHD_PANIC ("close failed\n"); + if (0 != CLOSE (daemon->worker_pool[i].wpipe[1])) + MHD_PANIC ("close failed\n"); + } + } } free (daemon->worker_pool); }