From edc635f51a4a9c161690d388f7cc1403102c8d97 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Thu, 16 Jul 2015 09:57:38 -0500 Subject: [PATCH] Skip buffer if empty string is read --- src/Stream/ReadableStreamTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Stream/ReadableStreamTrait.php b/src/Stream/ReadableStreamTrait.php index 38c0539..b5b2eae 100644 --- a/src/Stream/ReadableStreamTrait.php +++ b/src/Stream/ReadableStreamTrait.php @@ -238,7 +238,7 @@ private function fetch($resource) if ($this->buffer->isEmpty()) { $data = (string) fread($resource, $this->length); - if (null === $this->byte) { + if (null === $this->byte || '' === $data) { return $data; }