summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2023-09-05 11:31:00 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-09-05 17:06:11 +0000
commit342cb33f714fccf0a404560fd43d0893763f1132 (patch)
tree5471b2ae5481aaa2f642c34d7d0752871a7b27ad
parentea2b28e1fc31bf87976c92c84985b36debe02187 (diff)
downloadnextcloud-server-342cb33f714fccf0a404560fd43d0893763f1132.tar.gz
nextcloud-server-342cb33f714fccf0a404560fd43d0893763f1132.zip
Apply suggestions from code review in View.php
Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com> Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--lib/private/Files/View.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index cd35aa31a08..0cf5e24616a 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -428,11 +428,11 @@ class View {
}
$handle = $this->fopen($path, 'rb');
if ($handle) {
- $chunkSize = 524288; // 512 kB chunks
+ $chunkSize = 524288; // 512 kiB chunks
while (!feof($handle)) {
echo fread($handle, $chunkSize);
- $this->checkConnectionStatus();
flush();
+ $this->checkConnectionStatus();
}
fclose($handle);
return $this->filesize($path);
@@ -484,8 +484,8 @@ class View {
$len = $chunkSize;
}
echo fread($handle, $len);
- $this->checkConnectionStatus();
flush();
+ $this->checkConnectionStatus();
}
return ftell($handle) - $from;
}
@@ -498,7 +498,7 @@ class View {
private function checkConnectionStatus(): void {
$connectionStatus = \connection_status();
- if ($connectionStatus !== 0) {
+ if ($connectionStatus !== CONNECTION_NORMAL) {
throw new ConnectionLostException("Connection lost. Status: $connectionStatus");
}
}