diff options
author | Robin Appelman <robin@icewind.nl> | 2018-08-08 16:07:41 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2018-08-08 16:07:41 +0200 |
commit | 24aaa3bc970bfb6b4af4d375ac5ba0aac16db2dd (patch) | |
tree | 0bf28e321073ad9c237dcb8b98c7d03097c2d5d2 /apps/files_external/lib | |
parent | 6b1ba9cdaf3ce5d63e6e46bcbc677cf7933f5fb3 (diff) | |
download | nextcloud-server-24aaa3bc970bfb6b4af4d375ac5ba0aac16db2dd.tar.gz nextcloud-server-24aaa3bc970bfb6b4af4d375ac5ba0aac16db2dd.zip |
retry stat on timeout
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 9 |
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 9c0e6910309..b37ffd3067d 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; @@ -244,13 +245,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(); |