diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-15 14:15:45 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-15 14:15:45 +0300 |
commit | 5a6b2956d807f16b162eea43f6c25b386d76dc19 (patch) | |
tree | e78fb3d0b7e87201ddb820242539ef52716a6b0f /lib | |
parent | 99de93a6c6e6a78d36f0d5bed41538e9739b32c5 (diff) | |
parent | 91c7d293ca0c41addd25d79fa060be6506d898b1 (diff) |
Merge pull request #23022 from owncloud/stable9_backport_22602
[stable 9] Do not check all chunks of a chunked upload if we do not need to
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/filechunking.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/filechunking.php b/lib/private/filechunking.php index ece215e7344..32cbb7559f0 100644 --- a/lib/private/filechunking.php +++ b/lib/private/filechunking.php @@ -74,14 +74,16 @@ class OC_FileChunking { public function isComplete() { $prefix = $this->getPrefix(); - $parts = 0; $cache = $this->getCache(); - for($i=0; $i < $this->info['chunkcount']; $i++) { - if ($cache->hasKey($prefix.$i)) { - $parts ++; + $chunkcount = (int)$this->info['chunkcount']; + + for($i=($chunkcount-1); $i >= 0; $i--) { + if (!$cache->hasKey($prefix.$i)) { + return false; } } - return $parts == $this->info['chunkcount']; + + return true; } /** |