Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
set stream size for SeekableHttpStream
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Jun 12, 2023
commit d2d870464560e411a60630413a334f5fec5770fc
8 changes: 7 additions & 1 deletion lib/private/Files/Stream/SeekableHttpStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static function open(callable $callback) {
private int $offset = 0;
private int $length = 0;
private bool $needReconnect = false;
private int $totalSize = 0;

private function reconnect(int $start): bool {
$this->needReconnect = false;
Expand Down Expand Up @@ -128,6 +129,9 @@ private function reconnect(int $start): bool {

$this->offset = $begin;
$this->length = $length;
if ($start === 0) {
$this->totalSize = $length;
}

return true;
}
Expand Down Expand Up @@ -211,7 +215,9 @@ public function stream_tell() {

public function stream_stat() {
if ($this->getCurrent()) {
return fstat($this->getCurrent());
$stat = fstat($this->getCurrent());
$stat['size'] = $this->totalSize;
return $stat;
} else {
return false;
}
Expand Down