Checksums on chunked files

We should also store checksums on chunked files.
We do not checksum individual chunks but only the final file.
This commit is contained in:
Roeland Jago Douma 2016-02-28 20:21:43 +01:00 committed by Vincent Petry
parent 3e88a5067f
commit ec140fa2ec
1 changed files with 8 additions and 0 deletions

View File

@ -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);