protected function send_response($code, array $headers = array(), $body = null)
{
// send out response line
$this->send_line($code);
// set content length of body exists and is not already set
if ($body && !isset($headers['Content-Length'])) {
$headers['Content-Length'] = strlen($body);
}
// send out headers
$this->send_headers($code, $headers);
// send body
// prefixed with an empty line
JAXLLogger::debug("sending out HTTP_CRLF prefixed body");
if ($body) {
$this->send_body(HTTPServer::HTTP_CRLF . $body);
}
}