dont do optimized size propagation for encrypted files

This commit is contained in:
Robin Appelman 2016-04-20 15:22:22 +02:00
parent 440cf335ad
commit 74ed0a8aba
2 changed files with 11 additions and 1 deletions

View File

@ -205,6 +205,10 @@ class Scanner extends BasicEmitter implements IScanner {
$data['oldSize'] = 0;
}
if (isset($cacheData['encrypted'])) {
$data['encrypted'] = $cacheData['encrypted'];
}
// post-emit only if it was a file. By that we avoid counting/treating folders as files
if ($data['mimetype'] !== 'httpd/unix-directory') {
$this->emit('\OC\Files\Cache\Scanner', 'postScanFile', array($file, $this->storageId));
@ -222,6 +226,9 @@ class Scanner extends BasicEmitter implements IScanner {
}
}
if ($data && !isset($data['encrypted'])) {
$data['encrypted'] = false;
}
return $data;
}

View File

@ -118,7 +118,10 @@ class Updater implements IUpdater {
}
$data = $this->scanner->scan($path, Scanner::SCAN_SHALLOW, -1, false);
if (isset($data['oldSize']) && isset($data['size'])) {
if (
isset($data['oldSize']) && isset($data['size']) &&
!$data['encrypted'] // encryption is a pita and touches the cache itself
) {
$sizeDifference = $data['size'] - $data['oldSize'];
} else {
// scanner didn't provide size info, fallback to full size calculation