Skip to content

Commit

Permalink
If initial read returns an empty string *or* null, handle EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed May 22, 2023
1 parent 6c28c55 commit 568b826
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/php/xp/web/srv/Input.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function consume($limit= 16384) {

// If we instantly get an EOF while reading, it's either a preconnect
// or a kept-alive socket being closed.
if ('' === ($this->buffer= $this->socket->read())) {
if ('' === ($this->buffer= $this->socket->read() ?? '')) {
return $this->kind= self::CLOSE;
}

Expand Down

0 comments on commit 568b826

Please sign in to comment.