summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-28 20:21:43 +0100
committerVincent Petry <pvince81@owncloud.com>2016-03-01 11:37:16 +0100
commitec140fa2ec2aaf489bae728971ec18e58719a38a (patch)
tree455f2b4603fbc934f90349c5718aad89fc191655
parent3e88a5067f3ef6fd81068f85a00ee2a49a8f9b79 (diff)
downloadnextcloud-server-ec140fa2ec2aaf489bae728971ec18e58719a38a.tar.gz
nextcloud-server-ec140fa2ec2aaf489bae728971ec18e58719a38a.zip
Checksums on chunked files
We should also store checksums on chunked files. We do not checksum individual chunks but only the final file.
-rw-r--r--apps/dav/lib/connector/sabre/file.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php
index b7e2108db3b..b71c4ccc621 100644
--- a/apps/dav/lib/connector/sabre/file.php
+++ b/apps/dav/lib/connector/sabre/file.php
@@ -457,6 +457,14 @@ class File extends Node implements IFile {
$this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED);
+ if (isset($request->server['HTTP_OC_CHECKSUM'])) {
+ $checksum = trim($request->server['HTTP_OC_CHECKSUM']);
+ $this->fileView->putFileInfo($targetPath, ['checksum' => $checksum]);
+ } else if ($this->getChecksum() !== NULL && $this->getChecksum() !== '') {
+ $this->fileView->putFileInfo($this->path, ['checksum' => '']);
+ }
+ $this->refreshInfo();
+
$this->emitPostHooks($exists, $targetPath);
$info = $this->fileView->getFileInfo($targetPath);