aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-08-12 11:15:26 +0000
committerLRN <lrn1986@gmail.com>2013-08-12 11:15:26 +0000
commita9dcda31621696b7713db4bd89a7c02e7e4682e4 (patch)
treef7c3647dbc1ed213a36af9af419bffc401fd4669
parente9a319277b58c9d55629cdd8d34a82cc7bee640e (diff)
downloadlibmicrohttpd-a9dcda31621696b7713db4bd89a7c02e7e4682e4.tar.gz
libmicrohttpd-a9dcda31621696b7713db4bd89a7c02e7e4682e4.zip
Use socketpair to wake up listenthread on W32
-rw-r--r--src/include/microhttpd.h1
-rw-r--r--src/microhttpd/daemon.c7
-rw-r--r--src/microhttpd/internal.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 9251a4bc..45476f9a 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -430,6 +430,7 @@ enum MHD_FLAG
430 * use of this option is automatic (as in, you do not even have to 430 * use of this option is automatic (as in, you do not even have to
431 * specify it), if 'MHD_USE_NO_LISTEN_SOCKET' is specified. In 431 * specify it), if 'MHD_USE_NO_LISTEN_SOCKET' is specified. In
432 * "external" select mode, this option is always simply ignored. 432 * "external" select mode, this option is always simply ignored.
433 * On W32 a pair of sockets is used instead of a pipe.
433 */ 434 */
434 MHD_USE_PIPE_FOR_SHUTDOWN = 1024, 435 MHD_USE_PIPE_FOR_SHUTDOWN = 1024,
435 436
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 02314aa7..5d3c47bb 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2968,7 +2968,12 @@ MHD_start_daemon_va (unsigned int flags,
2968 if (0 == (flags & (MHD_USE_SELECT_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION))) 2968 if (0 == (flags & (MHD_USE_SELECT_INTERNALLY | MHD_USE_THREAD_PER_CONNECTION)))
2969 use_pipe = 0; /* useless if we are using 'external' select */ 2969 use_pipe = 0; /* useless if we are using 'external' select */
2970 if ( (use_pipe) && 2970 if ( (use_pipe) &&
2971 (0 != PIPE (daemon->wpipe)) ) 2971#ifdef WINDOWS
2972 (0 != SOCKETPAIR (AF_INET, SOCK_STREAM, IPPROTO_TCP, daemon->wpipe))
2973#else
2974 (0 != PIPE (daemon->wpipe))
2975#endif
2976 )
2972 { 2977 {
2973#if HAVE_MESSAGES 2978#if HAVE_MESSAGES
2974 MHD_DLOG (daemon, 2979 MHD_DLOG (daemon,
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 5c5605a7..7db85695 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1073,6 +1073,7 @@ struct MHD_Daemon
1073 * Pipe we use to signal shutdown, unless 1073 * Pipe we use to signal shutdown, unless
1074 * 'HAVE_LISTEN_SHUTDOWN' is defined AND we have a listen 1074 * 'HAVE_LISTEN_SHUTDOWN' is defined AND we have a listen
1075 * socket (which we can then 'shutdown' to stop listening). 1075 * socket (which we can then 'shutdown' to stop listening).
1076 * On W32 this is a socketpair, not a pipe.
1076 */ 1077 */
1077 int wpipe[2]; 1078 int wpipe[2];
1078 1079