summaryrefslogtreecommitdiff
path: root/server/vendor/guzzlehttp/psr7/src/CachingStream.php
diff options
context:
space:
mode:
authorroot <root@kabir-PC>2016-03-23 11:31:51 +0100
committerroot <root@kabir-PC>2016-03-23 11:31:51 +0100
commita26989103d70fb0dd3ff6834de107cae246778c3 (patch)
tree0f243c83b790ffb57f19261fc2a509131f6776ce /server/vendor/guzzlehttp/psr7/src/CachingStream.php
parent1342db60283cb61a1c3810993575d35b9fb33ac0 (diff)
parent6e78d76f887d1149ea85bfb06db7ee7ad7435f5a (diff)
Merge branch 'develop' of https://github.com/manzerbredes/istic-openstack into develop
Diffstat (limited to 'server/vendor/guzzlehttp/psr7/src/CachingStream.php')
-rw-r--r--server/vendor/guzzlehttp/psr7/src/CachingStream.php9
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);