AnyEvent-FCGI
view release on metacpan or search on metacpan
lib/AnyEvent/FCGI/Request.pm view on Meta::CPAN
fcgi => $params{fcgi},
connection => $params{connection},
flags => $params{flags},
stdin => '',
stdin_done => 0,
params => {},
params_string => '',
params_done => 0,
used_stderr => 0,
}, $class;
weaken($self->{fcgi});
weaken($self->{connection});
return $self;
}
sub _ready_check {
my $self = shift;
lib/AnyEvent/FCGI/Request.pm view on Meta::CPAN
request, sending it to the webserver to be sent to the client.
=cut
sub print_stdout {
my ($self, $data) = @_;
$self->_print_stream($data, AnyEvent::FCGI->FCGI_STDOUT);
}
=head2 print_stderr($data)
This method appends the given data to the STDERR stream of the FastCGI
request, sending it to the webserver.
=cut
sub print_stderr {
my ($self, $data) = @_;
$self->{used_stderr} = 1;
$self->_print_stream($data, AnyEvent::FCGI->FCGI_STDERR);
}
=head2 finish
When the request has been dealt with, this method should be called to indicate
to the webserver that it is finished. After calling this method, no more data
may be appended to the STDOUT stream.
=cut
lib/AnyEvent/FCGI/Request.pm view on Meta::CPAN
$self->_send_record({
request_id => $self->{id},
type => AnyEvent::FCGI->FCGI_STDOUT,
content => '',
});
$self->_send_record({
request_id => $self->{id},
type => AnyEvent::FCGI->FCGI_STDERR,
content => '',
}) if $self->{used_stderr};
$self->_send_record({
request_id => $self->{id},
type => AnyEvent::FCGI->FCGI_END_REQUEST,
content => pack('Ncccc', 0, AnyEvent::FCGI->FCGI_REQUEST_COMPLETE, 0, 0, 0),
});
$self->{connection}->{io}->push_shutdown unless $self->{flags} & AnyEvent::FCGI->FCGI_KEEP_CONN;
delete $self->{connection}->{requests}->{$self->{id}};
( run in 1.273 second using v1.01-cache-2.11-cpan-49f99fa48dc )