Any-Daemon-HTTP
view release on metacpan or search on metacpan
lib/Any/Daemon/FCGI/ClientConn.pm view on Meta::CPAN
238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
,
id
=>
$req_id
,
host
=>
$remote_host
||
$remote_ip
;
$self
->keep_connection
or
$self
->
socket
->
shutdown
(SHUT_RD);
$request
;
}
sub
send_response($;$)
{
my
(
$self
,
$response
,
$stderr
) =
@_
;
#XXX Net::Async::FastCGI::Request demonstrates how to catch stdout and
#XXX stderr via ties. We don't use that here: cleanly work with
#XXX HTTP::Message objects... errors are logged locally.
my
$req_id
=
$response
->request->request_id;
# Simply "Status: " in front of the Response header will make the whole
# message HTTP::Response into a valid CGI response.
$self
->_reply_record(
STDOUT
=>
$req_id
,
'Status: '
.
$response
->as_string(CRLF));
$self
->_reply_record(
STDOUT
=>
$req_id
,
''
);
if
(
$stderr
&&
length
$$stderr
)
{
$self
->_reply_record(
STDERR
=>
$req_id
,
$$stderr
);
$self
->_reply_record(
STDERR
=>
$req_id
,
''
);
}
$self
->_fcgi_end_request(
REQUEST_COMPLETE
=>
$req_id
);
$self
->keep_connection
or
$self
->
socket
->
shutdown
(SHUT_WR);
$self
;
}
( run in 0.268 second using v1.01-cache-2.11-cpan-cba739cd03b )