Fix undef warning in Engine::FastCGI
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / FastCGI.pm
index 9f7dfb2..30bb3a5 100644 (file)
@@ -113,6 +113,7 @@ sub run {
     if ($listen) {
         $options->{manager} ||= "FCGI::ProcManager";
         $options->{nproc}   ||= 1;
+        $options->{proc_title} ||= "perl-fcgi-pm [$class]";
 
         $self->daemon_fork() if $options->{detach};
 
@@ -123,6 +124,7 @@ sub run {
                 {
                     n_processes => $options->{nproc},
                     pid_fname   => $options->{pidfile},
+                    pm_title => $options->{proc_title},
                 }
             );
 
@@ -157,6 +159,10 @@ sub run {
 sub write {
     my ( $self, $c, $buffer ) = @_;
 
+    # ->write will be called once with the body, even in a redirect (and
+    # in that case, the body is undef)
+    $buffer = '' if !defined $buffer;
+
     unless ( $self->_prepared_write ) {
         $self->prepare_write($c);
         $self->_prepared_write(1);
@@ -297,7 +303,7 @@ static, and dynamic.
 =head3 Standalone server mode
 
     FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket
-    Alias /myapp/ /tmp/myapp/myapp.fcgi/
+    Alias /myapp/ /tmp/myapp.fcgi/
 
     # Or, run at the root
     Alias / /tmp/myapp.fcgi/