aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/microhttpd/daemon.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 46eeb380..10de8a3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
1Tue Nov 26 01:26:15 CET 2013
2 Fix race on shutdown signal with thread pool on non-Linux
3 systems by signalling n times for n threads. -CG
4
1Sun Nov 24 13:41:15 CET 2013 5Sun Nov 24 13:41:15 CET 2013
2 Introduce state to mark connections in suspended state (with 6 Introduce state to mark connections in suspended state (with
3 epoll); add missing locking operations in MHD_suspend_connection. 7 epoll); add missing locking operations in MHD_suspend_connection.
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 219e822f..ac0299b9 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1894,7 +1894,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
1894 const fd_set *except_fd_set) 1894 const fd_set *except_fd_set)
1895{ 1895{
1896 int ds; 1896 int ds;
1897 int tmp; 1897 char tmp;
1898 struct MHD_Connection *pos; 1898 struct MHD_Connection *pos;
1899 struct MHD_Connection *next; 1899 struct MHD_Connection *next;
1900 1900
@@ -3812,7 +3812,7 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
3812 if (-1 != daemon->wpipe[1]) 3812 if (-1 != daemon->wpipe[1])
3813 { 3813 {
3814 if (1 != WRITE (daemon->wpipe[1], "e", 1)) 3814 if (1 != WRITE (daemon->wpipe[1], "e", 1))
3815 MHD_PANIC ("failed to signal shutdownn via pipe"); 3815 MHD_PANIC ("failed to signal shutdown via pipe");
3816 } 3816 }
3817#ifdef HAVE_LISTEN_SHUTDOWN 3817#ifdef HAVE_LISTEN_SHUTDOWN
3818 else 3818 else
@@ -3842,6 +3842,11 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
3842 /* MHD_USE_NO_LISTEN_SOCKET disables thread pools, hence we need to check */ 3842 /* MHD_USE_NO_LISTEN_SOCKET disables thread pools, hence we need to check */
3843 for (i = 0; i < daemon->worker_pool_size; ++i) 3843 for (i = 0; i < daemon->worker_pool_size; ++i)
3844 { 3844 {
3845 if (-1 != daemon->wpipe[1])
3846 {
3847 if (1 != WRITE (daemon->wpipe[1], "e", 1))
3848 MHD_PANIC ("failed to signal shutdown via pipe");
3849 }
3845 if (0 != (rc = pthread_join (daemon->worker_pool[i].pid, &unused))) 3850 if (0 != (rc = pthread_join (daemon->worker_pool[i].pid, &unused)))
3846 MHD_PANIC ("Failed to join a thread\n"); 3851 MHD_PANIC ("Failed to join a thread\n");
3847 close_all_connections (&daemon->worker_pool[i]); 3852 close_all_connections (&daemon->worker_pool[i]);