aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCSILLAG Tamas <cstamas@cstamas.hu>2013-08-12 15:39:35 +0200
committerSimon Paillard <spaillard@debian.org>2013-08-26 21:32:43 +0200
commit0a2638c0000081bcfb954f2d983f6b79f9722997 (patch)
treef9ec19b94d8fcaba62d25cd9d1fca3d388fdb3c6
parenta8e784f63de71592285734cac87a975c6ea0ac35 (diff)
port Dispatcher.pm from CGI to CGI::Fast
(cherry picked from commit 5b1058f0451276e8d11edd10c55a813436f060aa)
-rwxr-xr-xlib/Packages/Dispatcher.pm20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/Packages/Dispatcher.pm b/lib/Packages/Dispatcher.pm
index e24b9e8..7e0b521 100755
--- a/lib/Packages/Dispatcher.pm
+++ b/lib/Packages/Dispatcher.pm
@@ -22,7 +22,7 @@ package Packages::Dispatcher;
use strict;
use warnings;
-use CGI;
+use CGI::Fast;
use POSIX;
use File::Basename;
use Template;
@@ -51,6 +51,11 @@ use Packages::DoNewPkg;
use Packages::DoDownload;
use Packages::DoFilelist;
+sub fastcgi_dispatch {
+ while (my $q = new CGI::Fast) {
+ do_dispatch( $q );
+ }
+}
sub do_dispatch {
@@ -75,16 +80,7 @@ sub do_dispatch {
'stable-backports' => 'wheezy-backports' );
# Read in all the variables set by the form
- my $input;
- if ($ARGV[0] && ($ARGV[0] eq 'php')) {
- $input = new CGI(\*STDIN);
- } else {
- $input = new CGI;
- }
- my $cgi_error = $input->cgi_error;
- if ($cgi_error) {
- fatal_error( "Error parsing the request", $cgi_error );
- }
+ my $input = shift;
my $pet0 = new Benchmark;
my $tet0 = new Benchmark;
@@ -108,7 +104,7 @@ sub do_dispatch {
if ($client_timestamp >= $last_modified) {
# we are not modified since asked -> return "304 Not Modified"
print $input->header(-status => 304);
- exit;
+ return;
}
}