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"); } }