diff --git a/composer.json b/composer.json index e7739754..4f4d4aa8 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,8 @@ "react/event-loop": "^1.0 || ^0.5", "react/promise": "^2.3 || ^1.2.1", "react/promise-stream": "^1.1", - "react/socket": "^1.1", - "react/stream": "^1.0 || ^0.7.5", + "react/socket": "^1.6", + "react/stream": "^1.1", "ringcentral/psr7": "^1.2" }, "require-dev": { diff --git a/examples/99-server-benchmark-download.php b/examples/99-server-benchmark-download.php index 536f4515..5fdd55c9 100644 --- a/examples/99-server-benchmark-download.php +++ b/examples/99-server-benchmark-download.php @@ -119,7 +119,7 @@ public function getSize() ); }); -$socket = new \React\Socket\Server(isset($argv[1]) ? $argv[1] : '0.0.0.0:0', $loop, array('tcp' => array('backlog' => 511))); +$socket = new \React\Socket\Server(isset($argv[1]) ? $argv[1] : '0.0.0.0:0', $loop); $server->listen($socket); echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL; diff --git a/src/Io/ChunkedDecoder.php b/src/Io/ChunkedDecoder.php index 45642a63..2f58f42b 100644 --- a/src/Io/ChunkedDecoder.php +++ b/src/Io/ChunkedDecoder.php @@ -123,7 +123,7 @@ public function handleData($data) } $this->chunkSize = @\hexdec($hexValue); - if (\dechex($this->chunkSize) !== $hexValue) { + if (!\is_int($this->chunkSize) || \dechex($this->chunkSize) !== $hexValue) { $this->handleError(new Exception($hexValue . ' is not a valid hexadecimal number')); return; }