Skip to content
Snippets Groups Projects
Commit 8394985e authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #23672 from owncloud/use-retry-wrapper-for-sftp

Use RetryWrapper for SFTP storage
parents 52f51c94 3dc5c59e
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
namespace OC\Files\Storage; namespace OC\Files\Storage;
use Icewind\Streams\IteratorDirectory; use Icewind\Streams\IteratorDirectory;
use Icewind\Streams\RetryWrapper;
use phpseclib\Net\SFTP\Stream; use phpseclib\Net\SFTP\Stream;
/** /**
...@@ -374,7 +375,8 @@ class SFTP extends \OC\Files\Storage\Common { ...@@ -374,7 +375,8 @@ class SFTP extends \OC\Files\Storage\Common {
case 'c': case 'c':
case 'c+': case 'c+':
$context = stream_context_create(array('sftp' => array('session' => $this->getConnection()))); $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) { } catch (\Exception $e) {
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment