From 3f64cea3571c5ee5f98fd6ec9de1d667e85cc8ac Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 12 Apr 2011 15:26:25 +0000 Subject: [PATCH] AP_ENABLE_V4_MAPPED with WinNT MPM mpm_winnt.c: Fail to compile if enabled, and add a hint about the issue to address before it will work. configure.in: Move the --enable-v4-mapped check to below the MPM logic, and default to --disable-v4-mapped if using the WinNT MPM git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1091467 13f79535-47bb-0310-9956-ffa450edef68 --- configure.in | 47 +++++++++++++++++++----------------- server/mpm/winnt/mpm_winnt.c | 10 ++++++++ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/configure.in b/configure.in index 8afe224cbe7..93d6029dc76 100644 --- a/configure.in +++ b/configure.in @@ -512,28 +512,6 @@ esac APACHE_SUBST(DTRACE) -APR_CHECK_APR_DEFINE(APR_HAVE_IPV6) - -AC_ARG_ENABLE(v4-mapped,APACHE_HELP_STRING(--enable-v4-mapped,Allow IPv6 sockets to handle IPv4 connections), -[ - v4mapped=$enableval -], -[ - case $host in - *freebsd5*|*netbsd*|*openbsd*) - v4mapped=no - ;; - *) - v4mapped=yes - ;; -esac -]) - -if test $v4mapped = "yes" -a $ac_cv_define_APR_HAVE_IPV6 = "yes"; then - AC_DEFINE(AP_ENABLE_V4_MAPPED, 1, - [Allow IPv4 connections on IPv6 listening sockets]) -fi - AC_ARG_ENABLE(exception-hook,APACHE_HELP_STRING(--enable-exception-hook,Enable fatal exception hook), [ AC_DEFINE(AP_ENABLE_EXCEPTION_HOOK, 1, @@ -714,6 +692,31 @@ if test "$AP_NONBLOCK_WHEN_MULTI_LISTEN" = "1"; then [Listening sockets are non-blocking when there are more than 1]) fi +APR_CHECK_APR_DEFINE(APR_HAVE_IPV6) + +AC_ARG_ENABLE(v4-mapped,APACHE_HELP_STRING(--enable-v4-mapped,Allow IPv6 sockets to handle IPv4 connections), +[ + v4mapped=$enableval +], +[ + case $host in + *freebsd5*|*netbsd*|*openbsd*) + v4mapped=no + ;; + *) + v4mapped=yes + ;; + esac + if ap_mpm_is_enabled winnt; then + dnl WinNT MPM doesn't support this. + v4mapped=no + fi +]) + +if test $v4mapped = "yes" -a $ac_cv_define_APR_HAVE_IPV6 = "yes"; then + AC_DEFINE(AP_ENABLE_V4_MAPPED, 1, + [Allow IPv4 connections on IPv6 listening sockets]) +fi APACHE_FAST_OUTPUT(Makefile modules/Makefile srclib/Makefile) APACHE_FAST_OUTPUT(os/Makefile server/Makefile) diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 777f0e57abc..0d68ea3bc48 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -48,6 +48,16 @@ #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000 #endif +/* Because ap_setup_listeners() is skipped in the child, any merging + * of [::]:80 and 0.0.0.0:80 for AP_ENABLE_V4_MAPPED in the parent + * won't have taken place in the child, so the child will expect to + * read two sockets for "Listen 80" but the parent will send only + * one. + */ +#ifdef AP_ENABLE_V4_MAPPED +#error The WinNT MPM does not currently support AP_ENABLE_V4_MAPPED +#endif + /* scoreboard.c does the heavy lifting; all we do is create the child * score by moving a handle down the pipe into the child's stdin. */ -- 2.47.2