From 606e568c35a5752560ee31e1be7f4b64fefe31cd Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 27 Dec 2010 14:19:08 -0800 Subject: Bug 599539: Update the mod_perl code for Apache2::SizeLimit 0.92 r=glob, a=mkanat --- Bugzilla/Install/Requirements.pm | 18 ++++++++++++++++++ mod_perl.pl | 19 +++++-------------- template/en/default/pages/release-notes.html.tmpl | 4 ++-- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index ea2b313fd..f629abeeb 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -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; diff --git a/mod_perl.pl b/mod_perl.pl index 15dec263a..abd018103 100644 --- a/mod_perl.pl +++ b/mod_perl.pl @@ -44,32 +44,23 @@ use Bugzilla::Util (); # Pre-compile the CGI.pm methods that we're going to use. Bugzilla::CGI->compile(qw(:cgi :push)); -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 = < 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 diff --git a/template/en/default/pages/release-notes.html.tmpl b/template/en/default/pages/release-notes.html.tmpl index 2b702a05e..445cd7966 100644 --- a/template/en/default/pages/release-notes.html.tmpl +++ b/template/en/default/pages/release-notes.html.tmpl @@ -98,8 +98,8 @@

Required Perl Modules

[% 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'] %]

Optional Perl Modules

-- cgit v1.2.3-24-g4f1b