mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
add locking for non-chunking webdav upload
This commit is contained in:
parent
72776b165f
commit
8665a98744
1 changed files with 5 additions and 0 deletions
|
|
@ -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() . '"';
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue