[Pkg-owncloud-commits] [owncloud] 227/457: add locking for non-chunking webdav upload
David Prévot
taffit at moszumanska.debian.org
Sun Jun 28 20:06: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 8665a98744a8d3545859b809fc479ea216e45176
Author: Robin Appelman <icewind at owncloud.com>
Date: Wed May 27 15:19:46 2015 +0200
add locking for non-chunking webdav upload
---
lib/private/connector/sabre/file.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 8e4460e..325206f 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -45,6 +45,7 @@ use OCP\Files\InvalidPathException;
use OCP\Files\LockNotAcquiredException;
use OCP\Files\NotPermittedException;
use OCP\Files\StorageNotAvailableException;
+use OCP\Lock\ILockingProvider;
use Sabre\DAV\Exception;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Exception\Forbidden;
@@ -110,6 +111,8 @@ class File extends Node implements IFile {
$partFilePath = $this->path;
}
+ $this->fileView->lockFile($this->path, ILockingProvider::LOCK_EXCLUSIVE);
+
// the part file and target file might be on a different storage in case of a single file storage (e.g. single file share)
/** @var \OC\Files\Storage\Storage $partStorage */
list($partStorage, $internalPartPath) = $this->fileView->resolvePath($partFilePath);
@@ -232,6 +235,8 @@ class File extends Node implements IFile {
throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage());
}
+ $this->fileView->unlockFile($this->path, ILockingProvider::LOCK_EXCLUSIVE);
+
return '"' . $this->info->getEtag() . '"';
}
--
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