Skip to content

Commit

Permalink
Use RetryWrapper for SFTP storage
Browse files Browse the repository at this point in the history
Equivalent to #23442

Required for making encryption work with external storage reliable.
  • Loading branch information
LukasReschke committed Mar 30, 2016
1 parent 456035a commit 1f7b037
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/files_external/lib/sftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
namespace OC\Files\Storage;
use Icewind\Streams\IteratorDirectory;

use Icewind\Streams\RetryWrapper;
use phpseclib\Net\SFTP\Stream;

/**
Expand Down Expand Up @@ -374,7 +375,8 @@ public function fopen($path, $mode) {
case 'c':
case 'c+':
$context = stream_context_create(array('sftp' => array('session' => $this->getConnection())));
return fopen($this->constructUrl($path), $mode, false, $context);
$handle = fopen($this->constructUrl($path), $mode, false, $context);
return RetryWrapper::wrap($handle);
}
} catch (\Exception $e) {
}
Expand Down

0 comments on commit 1f7b037

Please sign in to comment.