summaryrefslogtreecommitdiffstats
path: root/apps/files_external/3rdparty/icewind/streams
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-06-09 17:10:52 +0200
committerRobin Appelman <icewind@owncloud.com>2016-06-15 13:44:02 +0200
commit8dea26094b0d9abe59ef6dcfa20bc34b29bf8550 (patch)
tree7616d477f5e22a89b28a79f4b17f5e6b76f7335a /apps/files_external/3rdparty/icewind/streams
parent574b1e8d176050051ec5aee10b10ca51393ef5c5 (diff)
downloadnextcloud-server-8dea26094b0d9abe59ef6dcfa20bc34b29bf8550.tar.gz
nextcloud-server-8dea26094b0d9abe59ef6dcfa20bc34b29bf8550.zip
update icewind/streams to 0.4.1
Diffstat (limited to 'apps/files_external/3rdparty/icewind/streams')
-rw-r--r--apps/files_external/3rdparty/icewind/streams/src/RetryWrapper.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_external/3rdparty/icewind/streams/src/RetryWrapper.php b/apps/files_external/3rdparty/icewind/streams/src/RetryWrapper.php
index 84b43f6bd02..8238f19f7c9 100644
--- a/apps/files_external/3rdparty/icewind/streams/src/RetryWrapper.php
+++ b/apps/files_external/3rdparty/icewind/streams/src/RetryWrapper.php
@@ -44,7 +44,7 @@ class RetryWrapper extends Wrapper {
$result = parent::stream_read($count);
$bytesReceived = strlen($result);
- while ($bytesReceived < $count && !$this->stream_eof()) {
+ while (strlen($result) > 0 && $bytesReceived < $count && !$this->stream_eof()) {
$result .= parent::stream_read($count - $bytesReceived);
$bytesReceived = strlen($result);
}
@@ -54,11 +54,13 @@ class RetryWrapper extends Wrapper {
public function stream_write($data) {
$bytesToSend = strlen($data);
- $result = parent::stream_write($data);
+ $bytesWritten = parent::stream_write($data);
+ $result = $bytesWritten;
- while ($result < $bytesToSend && !$this->stream_eof()) {
+ while ($bytesWritten > 0 && $result < $bytesToSend && !$this->stream_eof()) {
$dataLeft = substr($data, $result);
- $result += parent::stream_write($dataLeft);
+ $bytesWritten = parent::stream_write($dataLeft);
+ $result += $bytesWritten;
}
return $result;