commit b742dc221dbd57b8d28e1881be23435f6109c572
parent c55535a0b8b1512875b988fd994282bf67169065
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 10 Aug 2013 15:33:50 +0000
-disable use of shutdown on W32
Diffstat:
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Aug 10 17:31:31 CEST 2013
+ Disable use of 'shutdown' on W32 always as winsock
+ doesn't properly behave with half-closed connections
+ (see http://www.chilkatsoft.com/p/p_299.asp). -CG/LRN
+
Thu Aug 8 07:55:07 CEST 2013
Fixing issue with pipelining not working as desired. -CG
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -439,8 +439,11 @@ enum MHD_FLAG
MHD_USE_DUAL_STACK = MHD_USE_IPv6 | 2048,
/**
- * Enable EPOLL turbo. Only useful with MHD_USE_EPOLL_LINUX_ONLY.
- * Highly experimental, do not use in production yet.
+ * Enable EPOLL turbo. Disables certain calls to 'shutdown'
+ * and enables aggressive non-blocking optimisitc reads.
+ * Most effects only happen with MHD_USE_EPOLL_LINUX_ONLY.
+ * Enalbed always on W32 as winsock doesn't properly behave
+ * with shutdown and this then fixes potential problems.
*/
MHD_USE_EPOLL_TURBO = 4096
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -2841,6 +2841,11 @@ MHD_start_daemon_va (unsigned int flags,
#endif
daemon->socket_fd = -1;
daemon->options = (enum MHD_OPTION) flags;
+#if WINDOWS
+ /* Winsock is broken with respect to 'shutdown';
+ this disables us calling 'shutdown' on W32. */
+ daemon->options |= MHD_USE_EPOLL_TURBO;
+#endif
daemon->port = port;
daemon->apc = apc;
daemon->apc_cls = apc_cls;