aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-08-08 16:07:41 +0200
committerRobin Appelman <robin@icewind.nl>2018-08-08 16:15:31 +0200
commit0450406c5042881f79407230863d3e15222eb849 (patch)
treee413d4799960cfa1873d4a398238f2cc4b1d16e5
parenta5985ad0f4697249f42c95cc5241a69df7acef09 (diff)
downloadnextcloud-server-0450406c5042881f79407230863d3e15222eb849.tar.gz
nextcloud-server-0450406c5042881f79407230863d3e15222eb849.zip
retry stat on timeout
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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 40fffce8342..dfe7df9349d 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;
@@ -230,13 +231,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();