dont do optimized size propagation for encrypted files

This commit is contained in:
Robin Appelman 2016-04-20 15:22:22 +02:00
parent b7867e9368
commit 5762a68c97
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -118,7 +118,10 @@ class Updater implements IUpdater {
} }
$data = $this->scanner->scan($path, Scanner::SCAN_SHALLOW, -1, false); $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']; $sizeDifference = $data['size'] - $data['oldSize'];
} else { } else {
// scanner didn't provide size info, fallback to full size calculation // scanner didn't provide size info, fallback to full size calculation