From 568b826e03d238d9119277d44e8800c30428018e Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Mon, 22 May 2023 21:50:18 +0200 Subject: [PATCH] If initial read returns an empty string *or* null, handle EOF --- src/main/php/xp/web/srv/Input.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/xp/web/srv/Input.class.php b/src/main/php/xp/web/srv/Input.class.php index 684d1486..cf09d1c5 100755 --- a/src/main/php/xp/web/srv/Input.class.php +++ b/src/main/php/xp/web/srv/Input.class.php @@ -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; }