Nasty hack for fastcgi, fixes gitalist
Tomas Doran [Mon, 23 Nov 2009 21:45:55 +0000 (21:45 +0000)]
Changes
lib/Catalyst/Engine/FastCGI.pm

diff --git a/Changes b/Changes
index 626944e..1901419 100644 (file)
--- a/Changes
+++ b/Changes
@@ -6,6 +6,8 @@
      upgraded, may get upgraded even after they are encoded, and will
      produce the same output either way, but bytes::length returns too big
      values for upgraded strings containing characters >127
+   - Make FastCGI compatible with modules which use the fileno call to
+     determine if a file is open (E.g. IPC::Run)
 
   Refactoring / cleanups:
    - NoTabs and Pod tests moved to t/author so that they're not run
index a6e9688..b8e0635 100644 (file)
@@ -144,6 +144,11 @@ sub run {
 
         $self->_fix_env( \%env );
 
+        # hack for perl libraries that use FILENO (e.g. IPC::Run)
+        # trying to patch FCGI.pm, but not got there yet :/
+        local *FCGI::Stream::FILENO = sub { -2 }
+            unless FCGI::Stream->can('FILENO');
+
         $class->handle_request( env => \%env );
 
         $proc_manager && $proc_manager->pm_post_dispatch();