]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 599539: Update the mod_perl.pl code for Apache2::SizeLimit 0.93
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 27 Dec 2010 22:20:34 +0000 (14:20 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Mon, 27 Dec 2010 22:20:34 +0000 (14:20 -0800)
r=glob, a=mkanat

Bugzilla/Install/Requirements.pm
mod_perl.pl
template/en/default/pages/release-notes.html.tmpl

index 77ac0ef448bbd3fc9c1dd181cc2a06e1b9e6dc92..dd661a9b0ebaa12d7afd354430cf0358e72ba31a 100644 (file)
@@ -319,8 +319,26 @@ sub OPTIONAL_MODULES {
         version => '1.999022',
         feature => ['mod_perl'],
     },
+    {
+        package => 'Apache-SizeLimit',
+        module  => 'Apache2::SizeLimit',
+        # 0.93 fixes problems on Linux and Windows, and changes the
+        # syntax used by SizeLimit.
+        version => '0.93',
+        feature => ['mod_perl'],
+    },
     );
 
+    if (ON_WINDOWS) {
+        # SizeLimit needs Win32::API to work on Windows.
+        push(@modules, {
+            package => 'Win32-API',
+            module  => 'Win32::API',
+            version => 0,
+            feature => ['mod_perl'],
+        });
+    }
+
     my $extra_modules = _get_extension_requirements('OPTIONAL_MODULES');
     push(@modules, @$extra_modules);
     return \@modules;
index 32fe82ccfe24ea92c4a433ad19be91c0f1d0508d..4a25d0c6133710fc5be5ac93e75848a1af27fa0b 100644 (file)
@@ -46,32 +46,23 @@ use Bugzilla::Mailer ();
 use Bugzilla::Template ();
 use Bugzilla::Util ();
 
-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";
-}
+use 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->set_max_unshared_size(70_000);
 
 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">
     AddHandler perl-script .cgi
     # No need to PerlModule these because they're already defined in mod_perl.pl
     PerlResponseHandler Bugzilla::ModPerl::ResponseHandler
-    PerlCleanupHandler  Bugzilla::ModPerl::CleanupHandler
-    $sizelimit
+    PerlCleanupHandler  Apache2::SizeLimit Bugzilla::ModPerl::CleanupHandler
     PerlOptions +ParseHeaders
     Options +ExecCGI
     AllowOverride Limit FileInfo Indexes
index 2b702a05ec341453d77902308b1759e08b41e454..445cd79663169a87b497a8a8cbaaae9d4ee64617 100644 (file)
@@ -98,8 +98,8 @@
 <h3 id="v40_req_modules">Required Perl Modules</h3>
 
 [% INCLUDE req_table reqs = REQUIRED_MODULES
-                     new = ['List-MoreUtils']
-                     updated = ['Email-MIME', 'CGI.pm'] %]
+                     new = ['List-MoreUtils', 'Win32-API']
+                     updated = ['Email-MIME', 'CGI.pm', 'Apache-SizeLimit'] %]
 
 <h3 id="v40_req_optional_mod">Optional Perl Modules</h3>