[Pkg-owncloud-commits] [owncloud] 14/205: handle locked exceptions when getting file/directory info in sabre

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 17:36:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 24f0151f812568f63584fbece5a8c50947b51dcd
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jun 16 14:37:41 2015 +0200

    handle locked exceptions when getting file/directory info in sabre
---
 lib/private/connector/sabre/directory.php  | 7 ++++++-
 lib/private/connector/sabre/objecttree.php | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php
index 85756f1..e994110 100644
--- a/lib/private/connector/sabre/directory.php
+++ b/lib/private/connector/sabre/directory.php
@@ -30,6 +30,7 @@ namespace OC\Connector\Sabre;
 use OC\Connector\Sabre\Exception\InvalidPath;
 use OC\Connector\Sabre\Exception\FileLocked;
 use OCP\Lock\LockedException;
+use Sabre\DAV\Exception\Locked;
 
 class Directory extends \OC\Connector\Sabre\Node
 	implements \Sabre\DAV\ICollection, \Sabre\DAV\IQuota {
@@ -191,7 +192,11 @@ class Directory extends \OC\Connector\Sabre\Node
 		if (!is_null($this->dirContent)) {
 			return $this->dirContent;
 		}
-		$folderContent = $this->fileView->getDirectoryContent($this->path);
+		try {
+			$folderContent = $this->fileView->getDirectoryContent($this->path);
+		} catch (LockedException $e) {
+			throw new Locked();
+		}
 
 		$nodes = array();
 		foreach ($folderContent as $info) {
diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php
index c96a745..1e9b9ba 100644
--- a/lib/private/connector/sabre/objecttree.php
+++ b/lib/private/connector/sabre/objecttree.php
@@ -150,6 +150,8 @@ class ObjectTree extends \Sabre\DAV\Tree {
 				throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage not available');
 			} catch (StorageInvalidException $e) {
 				throw new \Sabre\DAV\Exception\NotFound('Storage ' . $path . ' is invalid');
+			} catch (LockedException $e) {
+				throw new \Sabre\DAV\Exception\Locked();
 			}
 		}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list