Skip to content

Commit

Permalink
Merge pull request #22290 from owncloud/dav-upload-scan-in-lock
Browse files Browse the repository at this point in the history
scan the file in the write lock when uploading over dav
  • Loading branch information
DeepDiver1975 committed Feb 11, 2016
2 parents 73e3737 + bef70e9 commit 26939a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/dav/lib/connector/sabre/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ public function put($data) {
}
}

// since we skipped the view we need to scan and emit the hooks ourselves
$storage->getUpdater()->update($internalPath);

try {
$this->changeLock(ILockingProvider::LOCK_SHARED);
} catch (LockedException $e) {
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
}

// since we skipped the view we need to scan and emit the hooks ourselves
$storage->getUpdater()->update($internalPath);

if ($view) {
$this->emitPostHooks($exists);
}
Expand Down Expand Up @@ -450,11 +450,11 @@ private function createFileChunked($data) {
}
}

$this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED);

// since we skipped the view we need to scan and emit the hooks ourselves
$targetStorage->getUpdater()->update($targetInternalPath);

$this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED);

$this->emitPostHooks($exists, $targetPath);

$info = $this->fileView->getFileInfo($targetPath);
Expand Down

0 comments on commit 26939a2

Please sign in to comment.