Changeset 11766
- Timestamp:
- 05/17/08 19:11:29 (5 years ago)
- Location:
- lang/perl/HTTP-Engine/trunk
- Files:
-
- 2 modified
-
examples/lighty/test_fastcgi.pl (modified) (2 diffs)
-
lib/HTTP/Engine/Interface/FCGI.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/HTTP-Engine/trunk/examples/lighty/test_fastcgi.pl
r11120 r11766 2 2 use strict; 3 3 use warnings; 4 warn "OKGE";4 use FindBin '$Bin'; 5 5 use HTTP::Engine; 6 6 use Data::Dumper; … … 10 10 module => 'FCGI', 11 11 args => { 12 request_handler => sub { 13 my $c = shift; 12 # listen => $FindBin::Bin . 'test.socket', 13 }, 14 request_handler => sub { 15 my $c = shift; 14 16 15 $c->res->content_type('text/html');17 $c->res->content_type('text/html'); 16 18 17 $c->res->body( render_body( Dumper($c->req) ) ); 18 } 19 }, 19 $c->res->body( render_body( Dumper($c->req) ) ); 20 } 20 21 }, 21 22 )->run; -
lang/perl/HTTP-Engine/trunk/lib/HTTP/Engine/Interface/FCGI.pm
r11690 r11766 49 49 has listen => ( 50 50 is => 'ro', 51 isa => ' Int',51 isa => 'Str', 52 52 ); 53 53 … … 137 137 } 138 138 139 140 use HTTP::Engine::ResponseWriter; 141 HTTP::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 139 158 1; 140 159 __END__
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)