aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-03 09:29:31 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-03 09:29:31 +0000
commit7333727189f0c82dd42f6040149a1b1717bad615 (patch)
tree4ebd9173ef690d2e93a7aca1e5beff9bd806df53 /src
parent7b9cf32e4ea2763c16a14c44ab5b4423e8a9aaa9 (diff)
downloadlibmicrohttpd-7333727189f0c82dd42f6040149a1b1717bad615.tar.gz
libmicrohttpd-7333727189f0c82dd42f6040149a1b1717bad615.zip
fixing shutdown issue on OS X -- 1760
Diffstat (limited to 'src')
-rw-r--r--src/daemon/connection.c3
-rw-r--r--src/daemon/daemon.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c
index a7f3ceae..e30e019a 100644
--- a/src/daemon/connection.c
+++ b/src/daemon/connection.c
@@ -302,7 +302,8 @@ MHD_connection_close (struct MHD_Connection *connection,
302 struct MHD_Daemon *daemon; 302 struct MHD_Daemon *daemon;
303 303
304 daemon = connection->daemon; 304 daemon = connection->daemon;
305 SHUTDOWN (connection->socket_fd, SHUT_RDWR); 305 SHUTDOWN (connection->socket_fd,
306 (connection->read_closed == MHD_YES) ? SHUT_WR : SHUT_RDWR);
306 connection->state = MHD_CONNECTION_CLOSED; 307 connection->state = MHD_CONNECTION_CLOSED;
307 if ( (NULL != daemon->notify_completed) && 308 if ( (NULL != daemon->notify_completed) &&
308 (MHD_YES == connection->client_aware) ) 309 (MHD_YES == connection->client_aware) )
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index 280d7789..2b8eac5f 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -2445,7 +2445,8 @@ close_all_connections (struct MHD_Daemon *daemon)
2445 abort(); 2445 abort();
2446 } 2446 }
2447 for (pos = daemon->connections_head; pos != NULL; pos = pos->next) 2447 for (pos = daemon->connections_head; pos != NULL; pos = pos->next)
2448 SHUTDOWN (pos->socket_fd, SHUT_RDWR); 2448 SHUTDOWN (pos->socket_fd,
2449 (pos->read_closed == MHD_YES) ? SHUT_WR : SHUT_RDWR);
2449 if (0 != pthread_mutex_unlock(&daemon->cleanup_connection_mutex)) 2450 if (0 != pthread_mutex_unlock(&daemon->cleanup_connection_mutex))
2450 { 2451 {
2451#if HAVE_MESSAGES 2452#if HAVE_MESSAGES