summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-08-24 07:00:40 +0200
committerGitHub <noreply@github.com>2018-08-24 07:00:40 +0200
commit8563ab94aa6d45330eeda802f576457923a5b6e8 (patch)
treed2301b75892c31d7ced598e19e15b568f28e82dc /apps/files_external
parentd1daf65b78e5d3c192db0078995579c3ff4b6ab9 (diff)
parent24aaa3bc970bfb6b4af4d375ac5ba0aac16db2dd (diff)
downloadnextcloud-server-8563ab94aa6d45330eeda802f576457923a5b6e8.tar.gz
nextcloud-server-8563ab94aa6d45330eeda802f576457923a5b6e8.zip
Merge pull request #10589 from nextcloud/smb-stat-retry
retry smb stat on timeout
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/Lib/Storage/SMB.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php
index 6ed048455cc..760cc9ef98b 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -41,6 +41,7 @@ use Icewind\SMB\Exception\Exception;
use Icewind\SMB\Exception\ForbiddenException;
use Icewind\SMB\Exception\InvalidArgumentException;
use Icewind\SMB\Exception\NotFoundException;
+use Icewind\SMB\Exception\TimedOutException;
use Icewind\SMB\IFileInfo;
use Icewind\SMB\Native\NativeServer;
use Icewind\SMB\ServerFactory;
@@ -258,13 +259,19 @@ class SMB extends Common implements INotifyStorage {
return $result;
}
- public function stat($path) {
+ public function stat($path, $retry = true) {
try {
$result = $this->formatInfo($this->getFileInfo($path));
} catch (ForbiddenException $e) {
return false;
} catch (NotFoundException $e) {
return false;
+ } catch (TimedOutException $e) {
+ if ($retry) {
+ return $this->stat($path, false);
+ } else {
+ throw $e;
+ }
}
if ($this->remoteIsShare() && $this->isRootDir($path)) {
$result['mtime'] = $this->shareMTime();