| | 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 | |