protected function httpProcessHeaders()
{
$this->req->attrs->paramsDone = true;
if (isset($this->req->attrs->server['HTTP_CONNECTION']) && preg_match('~(?:^|\\W)Upgrade(?:\\W|$)~i', $this->req->attrs->server['HTTP_CONNECTION']) && isset($this->req->attrs->server['HTTP_UPGRADE']) && strtolower($this->req->attrs->server['HTTP_UPGRADE']) === 'websocket') {
if ($this->pool->WS) {
$this->pool->WS->inheritFromRequest($this->req, $this);
}
return false;
}
$this->req = Daemon::$appResolver->getRequest($this->req, $this, isset($this->pool->config->responder->value) ? $this->pool->config->responder->value : null);
if ($this->req instanceof \stdClass) {
$this->endRequest($this->req, 0, 0);
return false;
} else {
if ($this->pool->config->sendfile->value && (!$this->pool->config->sendfileonlybycommand->value || isset($this->req->attrs->server['USE_SENDFILE'])) && !isset($this->req->attrs->server['DONT_USE_SENDFILE'])) {
$req = $this->req;
FileSystem::tempnam($this->pool->config->sendfiledir->value, $this->pool->config->sendfileprefix->value, function ($fn) use($req) {
FileSystem::open($fn, 'wb', function ($file) use($req) {
$req->sendfp = $file;
});
$req->header('X-Sendfile: ' . $fn);
});
}
$this->req->callInit();
}
return true;
}