Skip to content
Snippets Groups Projects
Commit 16ff6cff authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #17256 from owncloud/locking-disablecallbackwrapperwhendisabled

Do not set callback wrapper when locking is disabled
parents 2c1b0f9a afd83caf
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment