]> git.uio.no Git - usit-rt.git/blobdiff - lib/RT/PlackRunner.pm
Master to 4.2.8
[usit-rt.git] / lib / RT / PlackRunner.pm
index 5f5975f9e4c0074de86d86b0010d35141ace529b..07a6740cd5af162c83fc4aaafebb2d88a15ce9af 100644 (file)
@@ -96,7 +96,9 @@ sub mangle_host_port_socket {
     my ($host, $port, $socket, @listen) = @_;
     return $self->SUPER::mangle_host_port_socket(@_)
         if @listen or $port or $socket;
-    return host => $host, port => $port, socket => $socket, listen => \@listen;
+
+    return host => $host, port => $port, socket => $socket,
+        @listen ? (listen => \@listen) : ();
 }
 
 sub app {
@@ -131,7 +133,7 @@ sub run {
     # Plack::Handler::FCGI has its own catch for this, but doesn't
     # notice that listen is an empty list, and we can also provide a
     # better error message.
-    if ($self->{server} eq "FCGI" and not -S STDIN and not @{$args{listen}}) {
+    if ($self->{server} eq "FCGI" and not -S STDIN and not @{$args{listen} || []}) {
         print STDERR "STDIN is not a socket, and no --listen, --socket, or --port provided\n";
         exit 1;
     }