summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-08-23 18:14:40 +0200
committerGitHub <noreply@github.com>2018-08-23 18:14:40 +0200
commit3940790e79c8311e50378a322a782b5503ed1b9e (patch)
tree4e0fb0728698760d52dcde37834acaf280b29e7d /apps
parent389b981aa554539b18663a469921464cfb1bd2d1 (diff)
parent0450406c5042881f79407230863d3e15222eb849 (diff)
downloadnextcloud-server-3940790e79c8311e50378a322a782b5503ed1b9e.tar.gz
nextcloud-server-3940790e79c8311e50378a322a782b5503ed1b9e.zip
Merge pull request #10591 from nextcloud/smb-stat-retry-13
[13] retry smb stat on timeout
Diffstat (limited to 'apps')
-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 230304575b4..adff2b1c2ff 100644
--- a/apps/files_external/lib/Lib/Storage/SMB.php
+++ b/apps/files_external/lib/Lib/Storage/SMB.php
@@ -40,6 +40,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\NativeServer;
use Icewind\SMB\Server;
@@ -235,13 +236,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();