Skip to content

Commit 913050f

Browse files
authored
Merge pull request #391 from clue-labs/php8
Support PHP 8, update to reactphp/socket v1.6 and adjust type checks for invalid chunk headers
2 parents 083c25e + cb90a6f commit 913050f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"react/event-loop": "^1.0 || ^0.5",
3333
"react/promise": "^2.3 || ^1.2.1",
3434
"react/promise-stream": "^1.1",
35-
"react/socket": "^1.1",
36-
"react/stream": "^1.0 || ^0.7.5",
35+
"react/socket": "^1.6",
36+
"react/stream": "^1.1",
3737
"ringcentral/psr7": "^1.2"
3838
},
3939
"require-dev": {

examples/99-server-benchmark-download.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function getSize()
119119
);
120120
});
121121

122-
$socket = new \React\Socket\Server(isset($argv[1]) ? $argv[1] : '0.0.0.0:0', $loop, array('tcp' => array('backlog' => 511)));
122+
$socket = new \React\Socket\Server(isset($argv[1]) ? $argv[1] : '0.0.0.0:0', $loop);
123123
$server->listen($socket);
124124

125125
echo 'Listening on ' . str_replace('tcp:', 'http:', $socket->getAddress()) . PHP_EOL;

src/Io/ChunkedDecoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function handleData($data)
123123
}
124124

125125
$this->chunkSize = @\hexdec($hexValue);
126-
if (\dechex($this->chunkSize) !== $hexValue) {
126+
if (!\is_int($this->chunkSize) || \dechex($this->chunkSize) !== $hexValue) {
127127
$this->handleError(new Exception($hexValue . ' is not a valid hexadecimal number'));
128128
return;
129129
}

0 commit comments

Comments
 (0)