Show
Ignore:
Timestamp:
05/17/08 19:11:29 (7 years ago)
Author:
yappo
Message:

fcgi broken

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-Engine/trunk/lib/HTTP/Engine/Interface/FCGI.pm

    r11690 r11766  
    4949has listen => ( 
    5050    is  => 'ro', 
    51     isa => 'Int', 
     51    isa => 'Str', 
    5252); 
    5353 
     
    137137} 
    138138 
     139 
     140use HTTP::Engine::ResponseWriter; 
     141HTTP::Engine::ResponseWriter->meta->add_method( write => sub { 
     142    my($self, $buffer) = @_; 
     143 
     144    unless ( $self->{_prepared_write} ) { 
     145        $self->prepare_write; 
     146        $self->{_prepared_write} = 1; 
     147    } 
     148 
     149    # XXX: We can't use Engine's write() method because syswrite 
     150    # appears to return bogus values instead of the number of bytes 
     151    # written: http://www.fastcgi.com/om_archive/mail-archive/0128.html 
     152 
     153    # FastCGI does not stream data properly if using 'print $handle', 
     154    # but a syswrite appears to work properly. 
     155    *STDOUT->syswrite($buffer); 
     156}); 
     157 
    1391581; 
    140159__END__