[Midnightbsd-cvs] mports [20483] trunk/Tools/magus/www/data/magus/index.cgi: make fast cgi compatible

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Oct 9 17:59:47 EDT 2015


Revision: 20483
          http://svnweb.midnightbsd.org/mports/?rev=20483
Author:   laffer1
Date:     2015-10-09 17:59:47 -0400 (Fri, 09 Oct 2015)
Log Message:
-----------
make fast cgi compatible

Modified Paths:
--------------
    trunk/Tools/magus/www/data/magus/index.cgi

Modified: trunk/Tools/magus/www/data/magus/index.cgi
===================================================================
--- trunk/Tools/magus/www/data/magus/index.cgi	2015-10-06 21:37:26 UTC (rev 20482)
+++ trunk/Tools/magus/www/data/magus/index.cgi	2015-10-09 21:59:47 UTC (rev 20483)
@@ -6,7 +6,7 @@
 use lib qw(/home/mbsd/magus/mports/Tools/lib);
 
 use Magus;
-use CGI;
+use CGI::Fast;
 use HTML::Template;
 use JSON::XS;
 
@@ -20,26 +20,28 @@
   use Class::DBI::AbstractSearch;
 }
 
-eval {
-  main();
-  exit 0;
-};
+while (my $p = CGI::Fast->new) {
+	eval {
+  		main($p);
+		exit 0;
+	};
 
-if ($@) {
-  print "Content-Type: text/html\n\n";
-  print <<END_OF_ERROR;
-      <html>
-      <head><title>Error</title></head>
-      <body>
-      <h1>Error</h1>
-      <p>The following error occured:</p>
-      <pre>$@</pre>
-END_OF_ERROR
-  exit 0;
+	if ($@) {
+	  print "Content-Type: text/html\n\n";
+	  print <<END_OF_ERROR;
+	      <html>
+	      <head><title>Error</title></head>
+	      <body>
+	      <h1>Error</h1>
+	      <p>The following error occured:</p>
+	      <pre>$@</pre>
+	  END_OF_ERROR
+	  exit 0;
+	}
 }
 
 sub main {
-  my $p = CGI->new;
+  my ($p) = @_;
   
   my $path = $p->path_info;
 



More information about the Midnightbsd-cvs mailing list