[Pkg-owncloud-commits] [owncloud] 52/85: Fix size calculation during recursive scan

David Prévot taffit at moszumanska.debian.org
Tue Jun 17 19:12:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch 6.0
in repository owncloud.

commit 129bfad204b7e861533ae1cd99fcf8f441b9d4b3
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jun 3 11:55:35 2014 +0200

    Fix size calculation during recursive scan
---
 lib/private/files/cache/scanner.php | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/lib/private/files/cache/scanner.php b/lib/private/files/cache/scanner.php
index 5df0b79..8c10d0f 100644
--- a/lib/private/files/cache/scanner.php
+++ b/lib/private/files/cache/scanner.php
@@ -175,7 +175,6 @@ class Scanner extends BasicEmitter {
 	 * @return int the id of the added file
 	 */
 	protected function addToCache($path, $data) {
-		echo "add";
 		\OC_Hook::emit('Scanner', 'addToCache', array('file' => $path, 'data' => $data));
 		$this->emit('\OC\Files\Cache\Scanner', 'addToCache', array($path, $this->storageId, $data));
 		if ($this->cacheActive) {
@@ -249,11 +248,8 @@ class Scanner extends BasicEmitter {
 							if ($data) {
 								if ($data['mimetype'] === 'httpd/unix-directory' and $recursive === self::SCAN_RECURSIVE) {
 									$childQueue[] = $child;
-								}
-								if ($data['size'] === -1) {
-									if ($recursive !== self::SCAN_RECURSIVE) {
-										$size = -1;
-									}
+								} else if ($data['size'] === -1) {
+									$size = -1;
 								} else if ($size !== -1) {
 									$size += $data['size'];
 								}
@@ -286,7 +282,7 @@ class Scanner extends BasicEmitter {
 				$childSize = $this->scanChildren($child, self::SCAN_RECURSIVE, $reuse);
 				if ($childSize === -1) {
 					$size = -1;
-				} else {
+				} else if ($size !== -1) {
 					$size += $childSize;
 				}
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list