From 03ef74d0cfe675a6e18a91f039182ca1b248d8f5 Mon Sep 17 00:00:00 2001 From: EoleDev Date: Wed, 9 Mar 2016 16:03:46 +0100 Subject: MAJ Librarys --- server/vendor/guzzlehttp/psr7/src/CachingStream.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/vendor/guzzlehttp/psr7/src/CachingStream.php') diff --git a/server/vendor/guzzlehttp/psr7/src/CachingStream.php b/server/vendor/guzzlehttp/psr7/src/CachingStream.php index 420d5b0..ed68f08 100644 --- a/server/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/server/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -60,9 +60,12 @@ class CachingStream implements StreamInterface $diff = $byte - $this->stream->getSize(); if ($diff > 0) { - // If the seek byte is greater the number of read bytes, then read - // the difference of bytes to cache the bytes and inherently seek. - $this->read($diff); + // Read the remoteStream until we have read in at least the amount + // of bytes requested, or we reach the end of the file. + while ($diff > 0 && !$this->remoteStream->eof()) { + $this->read($diff); + $diff = $byte - $this->stream->getSize(); + } } else { // We can just do a normal seek since we've already seen this byte. $this->stream->seek($byte); -- cgit v1.2.3