summaryrefslogtreecommitdiffstats
path: root/mod_perl.pl
diff options
context:
space:
mode:
authorMichael Thomas <mockodin@gmail.com>2010-02-01 21:34:58 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-01 21:34:58 +0100
commit7c239a7a387bf1a22df708a7ca05e596026ab73a (patch)
tree410ecabc20be54d1458f7bfe962abf8577f5a676 /mod_perl.pl
parent43e6512a0d4abd296f3672593a524a814e7f3e14 (diff)
downloadbugzilla-7c239a7a387bf1a22df708a7ca05e596026ab73a.tar.gz
bugzilla-7c239a7a387bf1a22df708a7ca05e596026ab73a.tar.xz
Bug 532318: In mod_perl on Windows, instead of using Apache2::SizeLimit, just set MaxRequestsPerChild
Patch by Michael Thomas <mockodin@gmail.com> r=mkanat, a=mkanat
Diffstat (limited to 'mod_perl.pl')
-rwxr-xr-xmod_perl.pl18
1 files changed, 13 insertions, 5 deletions
diff --git a/mod_perl.pl b/mod_perl.pl
index dac8622c8..a21d5d725 100755
--- a/mod_perl.pl
+++ b/mod_perl.pl
@@ -29,7 +29,6 @@ use strict;
# file.
use Apache2::ServerUtil;
-use Apache2::SizeLimit;
use ModPerl::RegistryLoader ();
use CGI ();
CGI->compile(qw(:cgi -no_xhtml -oldstyle_urls :private_tempfiles
@@ -47,15 +46,24 @@ use Bugzilla::Mailer ();
use Bugzilla::Template ();
use Bugzilla::Util ();
-# This means that every httpd child will die after processing
-# a CGI if it is taking up more than 70MB of RAM all by itself.
-$Apache2::SizeLimit::MAX_UNSHARED_SIZE = 70000;
+my ($sizelimit, $maxrequests) = ('', '');
+if (Bugzilla::Constants::ON_WINDOWS) {
+ $maxrequests = "MaxRequestsPerChild 25";
+}
+else {
+ require Apache2::SizeLimit;
+ # This means that every httpd child will die after processing
+ # a CGI if it is taking up more than 70MB of RAM all by itself.
+ $Apache2::SizeLimit::MAX_UNSHARED_SIZE = 70000;
+ $sizelimit = "PerlCleanupHandler Apache2::SizeLimit";
+}
my $cgi_path = Bugzilla::Constants::bz_locations()->{'cgi_path'};
# Set up the configuration for the web server
my $server = Apache2::ServerUtil->server;
my $conf = <<EOT;
+$maxrequests
# Make sure each httpd child receives a different random seed (bug 476622)
PerlChildInitHandler "sub { srand(); }"
<Directory "$cgi_path">
@@ -63,7 +71,7 @@ PerlChildInitHandler "sub { srand(); }"
# No need to PerlModule these because they're already defined in mod_perl.pl
PerlResponseHandler Bugzilla::ModPerl::ResponseHandler
PerlCleanupHandler Bugzilla::ModPerl::CleanupHandler
- PerlCleanupHandler Apache2::SizeLimit
+ $sizelimit
PerlOptions +ParseHeaders
Options +ExecCGI
AllowOverride Limit