You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2011/04/07 21:34:45 UTC

svn commit: r1089951 - /httpd/httpd/trunk/modules/generators/config5.m4

Author: trawick
Date: Thu Apr  7 19:34:44 2011
New Revision: 1089951

URL: http://svn.apache.org/viewvc?rev=1089951&view=rev
Log:
rework choice of cgi implementation, handling MinGW

PR: 49535 (subset of reported issues, replacement for supplied patch)

Modified:
    httpd/httpd/trunk/modules/generators/config5.m4

Modified: httpd/httpd/trunk/modules/generators/config5.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/config5.m4?rev=1089951&r1=1089950&r2=1089951&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/config5.m4 (original)
+++ httpd/httpd/trunk/modules/generators/config5.m4 Thu Apr  7 19:34:44 2011
@@ -11,9 +11,27 @@ APACHE_MODULE(info, server information, 
 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
   ])
     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