From bbff564bcfe4feff9b27b3bdd53ee4c541a218fb Mon Sep 17 00:00:00 2001 From: walkor Date: Tue, 29 Oct 2024 19:40:26 +0800 Subject: [PATCH] Delete redundant code --- src/Protocols/Http.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/Protocols/Http.php b/src/Protocols/Http.php index 379f24b7..304313fc 100644 --- a/src/Protocols/Http.php +++ b/src/Protocols/Http.php @@ -16,12 +16,10 @@ namespace Workerman\Protocols; -use Throwable; use Workerman\Connection\TcpConnection; use Workerman\Protocols\Http\Request; use Workerman\Protocols\Http\Response; use function clearstatcache; -use function count; use function explode; use function filesize; use function fopen; @@ -32,7 +30,6 @@ use function ini_get; use function is_array; use function is_object; -use function key; use function preg_match; use function strlen; use function strpos; @@ -135,23 +132,9 @@ public static function input(string $buffer, TcpConnection $connection): int */ public static function decode(string $buffer, TcpConnection $connection): Request { - static $requests = []; - if (isset($requests[$buffer])) { - $request = clone $requests[$buffer]; - $request->connection = $connection; - $connection->request = $request; - $request->properties = []; - return $request; - } $request = new static::$requestClass($buffer); $request->connection = $connection; $connection->request = $request; - if (!isset($buffer[TcpConnection::MAX_CACHE_STRING_LENGTH])) { - $requests[$buffer] = $request; - if (count($requests) > TcpConnection::MAX_CACHE_SIZE) { - unset($requests[key($requests)]); - } - } return $request; }