aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-09-25 16:32:32 +0200
committerGitHub <noreply@github.com>2023-09-25 16:32:32 +0200
commitdc347b39c14ce621049464944462352b95c419a1 (patch)
treecbe3f9b10097baf7b1dff3373aa0305cdd7e4b50 /lib
parentabeebd2f943fb13ad8de716b4efd48c642a6db3c (diff)
parent5090848b25af30f92bfdd3214d4f9f3cf0b14ca6 (diff)
downloadnextcloud-server-dc347b39c14ce621049464944462352b95c419a1.tar.gz
nextcloud-server-dc347b39c14ce621049464944462352b95c419a1.zip
Merge pull request #40501 from nextcloud/fix/fix-int-size-in-files-scanner
Store size in int|float for 32bit support
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Scanner.php9
-rw-r--r--lib/private/Files/ObjectStore/ObjectStoreScanner.php2
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index 52268032409..790221955f6 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -385,10 +385,10 @@ class Scanner extends BasicEmitter implements IScanner {
* @param int $reuse a combination of self::REUSE_*
* @param int $folderId id for the folder to be scanned
* @param bool $lock set to false to disable getting an additional read lock during scanning
- * @param int $oldSize the size of the folder before (re)scanning the children
+ * @param int|float $oldSize the size of the folder before (re)scanning the children
* @return int|float the size of the scanned folder or -1 if the size is unknown at this stage
*/
- protected function scanChildren(string $path, $recursive, int $reuse, int $folderId, bool $lock, int $oldSize) {
+ protected function scanChildren(string $path, $recursive, int $reuse, int $folderId, bool $lock, int|float $oldSize) {
if ($reuse === -1) {
$reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
}
@@ -418,7 +418,10 @@ class Scanner extends BasicEmitter implements IScanner {
return $size;
}
- private function handleChildren($path, $recursive, $reuse, $folderId, $lock, &$size) {
+ /**
+ * @param bool|IScanner::SCAN_RECURSIVE_INCOMPLETE $recursive
+ */
+ private function handleChildren(string $path, $recursive, int $reuse, int $folderId, bool $lock, int|float &$size): array {
// we put this in it's own function so it cleans up the memory before we start recursing
$existingChildren = $this->getExistingChildren($folderId);
$newChildren = iterator_to_array($this->storage->getDirectoryContent($path));
diff --git a/lib/private/Files/ObjectStore/ObjectStoreScanner.php b/lib/private/Files/ObjectStore/ObjectStoreScanner.php
index f001f90fdaa..d827662ae0b 100644
--- a/lib/private/Files/ObjectStore/ObjectStoreScanner.php
+++ b/lib/private/Files/ObjectStore/ObjectStoreScanner.php
@@ -39,7 +39,7 @@ class ObjectStoreScanner extends Scanner {
return [];
}
- protected function scanChildren(string $path, $recursive, int $reuse, int $folderId, bool $lock, int $oldSize) {
+ protected function scanChildren(string $path, $recursive, int $reuse, int $folderId, bool $lock, int|float $oldSize) {
return 0;
}