From 41f307ed78bdb0d814a60bf0ab7772b8a76763f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 22 Apr 2021 14:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnRequest.php | 5 ----- HttpServer/Http/Request.php | 14 +++----------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index 1ad03fed..108b0e43 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -49,9 +49,6 @@ class OnRequest extends Callback public function onHandler(Request $request, Response $response): mixed { try { - if (function_exists('trackerAnalyzeLeak')) { - trackerAnalyzeLeak(); - } /** @var HRequest $request */ [$request, $response] = OnRequest::createContext($request, $response); @@ -76,8 +73,6 @@ class OnRequest extends Callback * @param $request * @param $response * @return array - * @throws NotFindClassException - * @throws ReflectionException */ public static function createContext($request, $response): array { diff --git a/HttpServer/Http/Request.php b/HttpServer/Http/Request.php index 403eeb15..6cbdaada 100644 --- a/HttpServer/Http/Request.php +++ b/HttpServer/Http/Request.php @@ -463,13 +463,11 @@ class Request extends HttpService /** * @param $request * @return mixed - * @throws ReflectionException - * @throws NotFindClassException */ public static function create($request): Request { /** @var Request $sRequest */ - $sRequest = Context::setContext('request', Snowflake::createObject(Request::class)); + $sRequest = Context::setContext('request', new Request()); $sRequest->fd = $request->fd; $sRequest->startTime = microtime(true); @@ -490,13 +488,10 @@ class Request extends HttpService * @param $route * @param string $event * @return Request - * @throws NotFindClassException - * @throws ReflectionException */ public static function socketQuery($frame, $event = Socket::MESSAGE, $route = 'event'): Request { - /** @var Request $sRequest */ - $sRequest = Snowflake::createObject(Request::class); + $sRequest = new Request(); $sRequest->fd = $frame->fd; $sRequest->startTime = microtime(true); @@ -515,14 +510,11 @@ class Request extends HttpService * @param $data * @param int $reID * @return Request - * @throws NotFindClassException - * @throws ReflectionException * @throws Exception */ public static function createListenRequest($fd, $data, $reID = 0): Request { - /** @var Request $sRequest */ - $sRequest = Snowflake::createObject(Request::class); + $sRequest = new Request(); $sRequest->fd = is_array($fd) ? 0 : $fd; $sRequest->clientInfo = self::getClientInfo($fd, $reID);