aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-06-30 18:28:28 +0200
committerVincent Petry <pvince81@owncloud.com>2015-06-30 18:28:28 +0200
commit16ff6cff54768c15f126e523d195a6993e0e2aea (patch)
tree0fd33e42c9a26218e38f6d8f5dd46a90d56272a9
parent2c1b0f9a66fa991ee5324a6f34b4c09054889e54 (diff)
parentafd83caf69b2095cf401dd347b48fce891a1af86 (diff)
downloadnextcloud-server-16ff6cff54768c15f126e523d195a6993e0e2aea.tar.gz
nextcloud-server-16ff6cff54768c15f126e523d195a6993e0e2aea.zip
Merge pull request #17256 from owncloud/locking-disablecallbackwrapperwhendisabled
Do not set callback wrapper when locking is disabled
-rw-r--r--lib/private/files/view.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index f2df2eb0f69..1706818f03e 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 = '/') {
@@ -1026,7 +1029,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)) {