X Tutup
Skip to content

Commit fb51aac

Browse files
committed
Try to detect the connection status after flush() - this might lead to earlier detection of a broken connection
1 parent 9b1f480 commit fb51aac

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

changelog/unreleased/37291

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Bugfix: Earlier detection of connection status
2+
3+
On public video streaming the connection is detected to reduce server load #37219
4+
To optimize this the connection status is queried after flush()
5+
6+
https://github.com/owncloud/core/pull/37291

lib/private/Files/View.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,8 @@ public function readfile($path) {
475475
$size = $this->filesize($path);
476476
while (!\feof($handle)) {
477477
echo \fread($handle, $chunkSize);
478-
$this->checkConnectionStatus();
479478
\flush();
479+
$this->checkConnectionStatus();
480480
}
481481
return $size;
482482
}
@@ -505,8 +505,8 @@ public function readfilePart($path, $from, $to) {
505505
$len = $chunkSize;
506506
}
507507
echo \fread($handle, $len);
508-
$this->checkConnectionStatus();
509508
\flush();
509+
$this->checkConnectionStatus();
510510
}
511511
return \ftell($handle) - $from;
512512
}

0 commit comments

Comments
 (0)
X Tutup