diff options
author | Robin Appelman <icewind@owncloud.com> | 2016-04-20 15:22:22 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2016-04-21 13:18:24 +0200 |
commit | 5762a68c97a3c6e6571a570c2f63579cf09a890e (patch) | |
tree | 79900eb26b163b2c71364737a1717cea5ec5bcac | |
parent | b7867e93686985f0903abd40a0ec0544cd54ab6d (diff) | |
download | nextcloud-server-5762a68c97a3c6e6571a570c2f63579cf09a890e.tar.gz nextcloud-server-5762a68c97a3c6e6571a570c2f63579cf09a890e.zip |
dont do optimized size propagation for encrypted files
-rw-r--r-- | lib/private/files/cache/scanner.php | 7 | ||||
-rw-r--r-- | lib/private/files/cache/updater.php | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php index c16e8515b01..8730707f1c2 100644 --- a/lib/private/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php @@ -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; } diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index 80ba704883e..3f80f2b6167 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -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 |