From f761733f17cb1bce9e3a82dd2059f5a139f8d68b Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 21 Mar 2016 15:10:24 +0100 Subject: [PATCH] apply retry wrapper to make sure that we always read/write a complete block --- apps/files_external/lib/ftp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index 125888ef7223..338e2c14fa4c 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -30,6 +30,8 @@ namespace OC\Files\Storage; +use Icewind\Streams\RetryWrapper; + class FTP extends \OC\Files\Storage\StreamWrapper{ private $password; private $user; @@ -105,7 +107,8 @@ public function fopen($path,$mode) { case 'ab': //these are supported by the wrapper $context = stream_context_create(array('ftp' => array('overwrite' => true))); - return fopen($this->constructUrl($path), $mode, false, $context); + $handle = fopen($this->constructUrl($path), $mode, false, $context); + return RetryWrapper::wrap($handle); case 'r+': case 'w+': case 'wb+':