summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-03-01 11:24:10 +0100
committerVincent Petry <pvince81@owncloud.com>2016-03-01 11:44:49 +0100
commit57babe032b1c3abcf4e4208bb19488151a934470 (patch)
tree7417226aece841f7aca7cad14b384cf682d3b302 /apps/dav
parentac392457f24aed34dc2c5635d9ffd64ec256b061 (diff)
downloadnextcloud-server-57babe032b1c3abcf4e4208bb19488151a934470.tar.gz
nextcloud-server-57babe032b1c3abcf4e4208bb19488151a934470.zip
Save some calls to refreshInfo during upload
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/connector/sabre/file.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php
index 0bf7d9cf2bc..9c8344bc5db 100644
--- a/apps/dav/lib/connector/sabre/file.php
+++ b/apps/dav/lib/connector/sabre/file.php
@@ -220,10 +220,11 @@ class File extends Node implements IFile {
if (isset($request->server['HTTP_OC_CHECKSUM'])) {
$checksum = trim($request->server['HTTP_OC_CHECKSUM']);
$this->fileView->putFileInfo($this->path, ['checksum' => $checksum]);
- } else if ($this->getChecksum() !== NULL && $this->getChecksum() !== '') {
+ $this->refreshInfo();
+ } else if ($this->getChecksum() !== null && $this->getChecksum() !== '') {
$this->fileView->putFileInfo($this->path, ['checksum' => '']);
+ $this->refreshInfo();
}
- $this->refreshInfo();
} catch (StorageNotAvailableException $e) {
throw new ServiceUnavailable("Failed to check file size: " . $e->getMessage());
@@ -461,16 +462,16 @@ class File extends Node implements IFile {
$this->emitPostHooks($exists, $targetPath);
+ // FIXME: should call refreshInfo but can't because $this->path is not the of the final file
$info = $this->fileView->getFileInfo($targetPath);
if (isset($request->server['HTTP_OC_CHECKSUM'])) {
$checksum = trim($request->server['HTTP_OC_CHECKSUM']);
$this->fileView->putFileInfo($targetPath, ['checksum' => $checksum]);
- } else if ($info->getChecksum() !== NULL && $info->getChecksum() !== '') {
+ } else if ($info->getChecksum() !== null && $info->getChecksum() !== '') {
$this->fileView->putFileInfo($this->path, ['checksum' => '']);
}
-
$this->fileView->unlockFile($targetPath, ILockingProvider::LOCK_SHARED);
return $info->getEtag();