Skip to content

Commit

Permalink
apply retry wrapper to make sure that we always read/write a complete…
Browse files Browse the repository at this point in the history
… block
  • Loading branch information
Bjoern Schiessle committed Mar 21, 2016
1 parent 2309ef9 commit f761733
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 f761733

Please sign in to comment.