summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-06-12 16:28:34 +0200
committerRobin Appelman <robin@icewind.nl>2023-06-12 16:29:12 +0200
commitd2d870464560e411a60630413a334f5fec5770fc (patch)
tree3da489035462db05854161bf8c17763e013705dc /lib
parent42bfd97ea433db20c11d2472e29f7e06f0607496 (diff)
downloadnextcloud-server-d2d870464560e411a60630413a334f5fec5770fc.tar.gz
nextcloud-server-d2d870464560e411a60630413a334f5fec5770fc.zip
set stream size for SeekableHttpStream
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Stream/SeekableHttpStream.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/Stream/SeekableHttpStream.php b/lib/private/Files/Stream/SeekableHttpStream.php
index df37fd29f42..e53c20b5900 100644
--- a/lib/private/Files/Stream/SeekableHttpStream.php
+++ b/lib/private/Files/Stream/SeekableHttpStream.php
@@ -78,6 +78,7 @@ class SeekableHttpStream implements File {
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;
@@ -128,6 +129,9 @@ class SeekableHttpStream implements File {
$this->offset = $begin;
$this->length = $length;
+ if ($start === 0) {
+ $this->totalSize = $length;
+ }
return true;
}
@@ -211,7 +215,9 @@ class SeekableHttpStream implements File {
public function stream_stat() {
if ($this->getCurrent()) {
- return fstat($this->getCurrent());
+ $stat = fstat($this->getCurrent());
+ $stat['size'] = $this->totalSize;
+ return $stat;
} else {
return false;
}