diff --git a/src/Protocols/Http.php b/src/Protocols/Http.php index 379f24b74..304313fc7 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; }