aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 8ef00bd9..ea958204 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1078,9 +1078,7 @@ exit:
1078 MHD_CONNECTION_NOTIFY_CLOSED); 1078 MHD_CONNECTION_NOTIFY_CLOSED);
1079 if (MHD_INVALID_SOCKET != con->socket_fd) 1079 if (MHD_INVALID_SOCKET != con->socket_fd)
1080 { 1080 {
1081#ifdef WINDOWS
1082 shutdown (con->socket_fd, SHUT_WR); 1081 shutdown (con->socket_fd, SHUT_WR);
1083#endif
1084 if (0 != MHD_socket_close_ (con->socket_fd)) 1082 if (0 != MHD_socket_close_ (con->socket_fd))
1085 MHD_PANIC ("close failed\n"); 1083 MHD_PANIC ("close failed\n");
1086 con->socket_fd = MHD_INVALID_SOCKET; 1084 con->socket_fd = MHD_INVALID_SOCKET;
@@ -2115,9 +2113,6 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
2115 } 2113 }
2116 if (MHD_INVALID_SOCKET != pos->socket_fd) 2114 if (MHD_INVALID_SOCKET != pos->socket_fd)
2117 { 2115 {
2118#ifdef WINDOWS
2119 shutdown (pos->socket_fd, SHUT_WR);
2120#endif
2121 if (0 != MHD_socket_close_ (pos->socket_fd)) 2116 if (0 != MHD_socket_close_ (pos->socket_fd))
2122 MHD_PANIC ("close failed\n"); 2117 MHD_PANIC ("close failed\n");
2123 } 2118 }
@@ -3733,11 +3728,6 @@ MHD_start_daemon_va (unsigned int flags,
3733 daemon->socket_fd = MHD_INVALID_SOCKET; 3728 daemon->socket_fd = MHD_INVALID_SOCKET;
3734 daemon->listening_address_reuse = 0; 3729 daemon->listening_address_reuse = 0;
3735 daemon->options = flags; 3730 daemon->options = flags;
3736#if defined(MHD_WINSOCK_SOCKETS) || defined(CYGWIN)
3737 /* Winsock is broken with respect to 'shutdown';
3738 this disables us calling 'shutdown' on W32. */
3739 daemon->options |= MHD_USE_EPOLL_TURBO;
3740#endif
3741 daemon->port = port; 3731 daemon->port = port;
3742 daemon->apc = apc; 3732 daemon->apc = apc;
3743 daemon->apc_cls = apc_cls; 3733 daemon->apc_cls = apc_cls;
@@ -4451,8 +4441,7 @@ close_all_connections (struct MHD_Daemon *daemon)
4451 MHD_PANIC ("MHD_stop_daemon() called while we have suspended connections.\n"); 4441 MHD_PANIC ("MHD_stop_daemon() called while we have suspended connections.\n");
4452 for (pos = daemon->connections_head; NULL != pos; pos = pos->next) 4442 for (pos = daemon->connections_head; NULL != pos; pos = pos->next)
4453 { 4443 {
4454 shutdown (pos->socket_fd, 4444 shutdown (pos->socket_fd, SHUT_RDWR);
4455 (MHD_YES == pos->read_closed) ? SHUT_WR : SHUT_RDWR);
4456#if MHD_WINSOCK_SOCKETS 4445#if MHD_WINSOCK_SOCKETS
4457 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && 4446 if ( (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
4458 (MHD_INVALID_PIPE_ != daemon->wpipe[1]) && 4447 (MHD_INVALID_PIPE_ != daemon->wpipe[1]) &&