]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
rework choice of cgi implementation, handling MinGW
authorJeff Trawick <trawick@apache.org>
Thu, 7 Apr 2011 19:34:44 +0000 (19:34 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 7 Apr 2011 19:34:44 +0000 (19:34 +0000)
PR: 49535 (subset of reported issues, replacement for supplied patch)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1089951 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/config5.m4

index e3efda6134ab1a208524129c944be944a6394587..dc3b2d9dab63a5041ad2e05cf61e570c417863b6 100644 (file)
@@ -11,9 +11,27 @@ APACHE_MODULE(info, server information, , , most)
 APACHE_MODULE(suexec, set uid and gid for spawned processes, , , no, [
               other_targets=suexec ] )
 
-if ap_mpm_is_threaded; then
-# if we are using a threaded MPM, we will get better performance with
-# mod_cgid, so make it the default.
+# Is mod_cgid needed?
+case $host in
+    *mingw*)
+        dnl No fork+thread+fd issues, and cgid doesn't work anyway.
+        cgid_needed="no"
+        ;;
+    *)
+        if ap_mpm_is_threaded; then
+            dnl if we are using a threaded MPM on Unix, we can get better
+            dnl performance with mod_cgid, and also avoid potential issues
+            dnl with forking from a threaded process.
+            cgid_needed="yes"
+        else
+            dnl if we are using a non-threaded MPM, it makes little sense to
+            dnl use mod_cgid, and it just opens up holes we don't need.
+            cgid_needed="no"
+        fi
+        ;;
+esac
+
+if test $cgid_needed = "yes"; then
     APACHE_MODULE(cgid, CGI scripts.  Enabled by default with threaded MPMs, , , yes, [
     case $host in
       *-solaris2*)
@@ -54,9 +72,6 @@ For more info: <http://issues.apache.org/bugzilla/show_bug.cgi?id=34264>])
   ])
     APACHE_MODULE(cgi, CGI scripts.  Enabled by default with non-threaded MPMs, , , no)
 else
-# if we are using a non-threaded MPM, it makes little sense to use
-# mod_cgid, and it just opens up holes we don't need.  Make mod_cgi the
-# default
     APACHE_MODULE(cgi, CGI scripts.  Enabled by default with non-threaded MPMs, , , yes)
     APACHE_MODULE(cgid, CGI scripts.  Enabled by default with threaded MPMs, , , no)
 fi