Use RetryWrapper for SFTP storage

Equivalent to https://github.com/owncloud/core/pull/23442

Required for making encryption work with external storage reliable.
This commit is contained in:
Lukas Reschke 2016-03-30 22:45:09 +02:00
parent 456035a750
commit 1f7b037a59
1 changed files with 3 additions and 1 deletions

View File

@ -32,6 +32,7 @@
namespace OC\Files\Storage;
use Icewind\Streams\IteratorDirectory;
use Icewind\Streams\RetryWrapper;
use phpseclib\Net\SFTP\Stream;
/**
@ -374,7 +375,8 @@ class SFTP extends \OC\Files\Storage\Common {
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) {
}