Skip to content

Commit

Permalink
Merge pull request #23442 from owncloud/fix_22286_9.0
Browse files Browse the repository at this point in the history
[stable9] apply retry wrapper to make sure that we always read/write a complete block
  • Loading branch information
DeepDiver1975 committed Mar 22, 2016
2 parents 329e72a + 627724b commit d60f39e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/files_external/lib/ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

namespace OC\Files\Storage;

use Icewind\Streams\RetryWrapper;

class FTP extends \OC\Files\Storage\StreamWrapper{
private $password;
private $user;
Expand Down Expand Up @@ -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+':
Expand Down

0 comments on commit d60f39e

Please sign in to comment.