[Catalyst-commits] r13925 - Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script

hobbs at dev.catalyst.perl.org hobbs at dev.catalyst.perl.org
Mon Jan 24 19:57:47 GMT 2011


Author: hobbs
Date: 2011-01-24 19:57:47 +0000 (Mon, 24 Jan 2011)
New Revision: 13925

Modified:
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/FastCGI.pm
Log:
Beat the args handling in Script::FastCGI into working condition.


Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/FastCGI.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/FastCGI.pm	2011-01-24 11:29:24 UTC (rev 13924)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Script/FastCGI.pm	2011-01-24 19:57:47 UTC (rev 13925)
@@ -75,15 +75,33 @@
     $self->proc_title;
 }
 
+# Munge the 'listen' arg so that Plack::Handler::FCGI will accept it.
+sub _listen {
+    my ($self) = @_;
+
+    if (defined (my $listen = $self->listen)) {
+        return [ $listen ];
+    } else {
+        return undef;
+    }
+}
+
 sub _plack_loader_args {
     my ($self) = shift;
-    return (
-        map { $_->[0] => $self->${ \($_->[1] ? $_->[1]->[0] : $_->[0]) } }
-        Data::OptList::mkopt([
-            qw/pidfile listen manager nproc keep_stderr proc_title/,
-            detach     => [ 'daemon' ],
-        ])
-    );
+
+    my $opts = Data::OptList::mkopt([
+      qw/pidfile manager nproc proc_title/,
+            detach          => [ 'daemon' ],
+            keep_stderr     => [ 'keeperr' ],
+            listen          => [ '_listen' ],
+        ]);
+
+    my %args = map { $_->[0] => $self->${ \($_->[1] ? $_->[1]->[0] : $_->[0]) } } @$opts;
+
+    # Plack::Handler::FCGI thinks manager => undef means "use no manager".
+    delete $args{'manager'} unless defined $args{'manager'};
+
+    return %args;
 }
 
 sub _application_args {




More information about the Catalyst-commits mailing list