diff options
| author | EoleDev <root@serverpc.home> | 2016-03-09 16:03:46 +0100 |
|---|---|---|
| committer | EoleDev <root@serverpc.home> | 2016-03-09 16:03:46 +0100 |
| commit | 03ef74d0cfe675a6e18a91f039182ca1b248d8f5 (patch) | |
| tree | b1668c59fdbf9cb0b0a3da52bfc79e393a953573 /server/vendor/guzzlehttp/psr7/src/CachingStream.php | |
| parent | 1d3ed3af6d57316640c143002ddf80d61e6c098a (diff) | |
MAJ Librarys
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/src/CachingStream.php')
| -rw-r--r-- | server/vendor/guzzlehttp/psr7/src/CachingStream.php | 9 |
1 files changed, 6 insertions, 3 deletions
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); |
