[Pkg-owncloud-commits] [owncloud] 191/205: Do not set callback wrapper when locking is disabled

David Prévot taffit at moszumanska.debian.org
Thu Jul 2 17:37:12 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 afd83caf69b2095cf401dd347b48fce891a1af86
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Tue Jun 30 13:45:41 2015 +0200

    Do not set callback wrapper when locking is disabled
---
 lib/private/files/view.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 0c3bc54..5fa6a0a 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -79,6 +79,8 @@ class View {
 	 */
 	private $lockingProvider;
 
+	private $lockingEnabled;
+
 	/**
 	 * @param string $root
 	 * @throws \Exception If $root contains an invalid path
@@ -94,6 +96,7 @@ class View {
 		$this->fakeRoot = $root;
 		$this->updater = new Updater($this);
 		$this->lockingProvider = \OC::$server->getLockingProvider();
+		$this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider);
 	}
 
 	public function getAbsolutePath($path = '/') {
@@ -1021,7 +1024,7 @@ class View {
 				}
 
 				$unlockLater = false;
-				if ($operation === 'fopen' and is_resource($result)) {
+				if ($this->lockingEnabled && $operation === 'fopen' && is_resource($result)) {
 					$unlockLater = true;
 					$result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) {
 						if (in_array('write', $hooks)) {

-- 
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