aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-06-12 16:38:02 +0200
committerAndy Scherzinger <info@andy-scherzinger.de>2024-02-27 14:23:20 +0100
commitf6d57162bd2e343546585710abcb506ffef9c07b (patch)
tree8b040dfbc9b01bc87c9fcdd092e39d25059e5aed
parent250084f8b913e326e20ccc60c86091beab0a6524 (diff)
downloadnextcloud-server-stream-assembly-stream-size.tar.gz
nextcloud-server-stream-assembly-stream-size.zip
also log stream size when reporting unexpected chunk sizestream-assembly-stream-size
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--apps/dav/lib/Upload/AssemblyStream.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php
index ef6d39974c0..c8f98c7642f 100644
--- a/apps/dav/lib/Upload/AssemblyStream.php
+++ b/apps/dav/lib/Upload/AssemblyStream.php
@@ -153,10 +153,14 @@ class AssemblyStream implements \Icewind\Streams\File {
$this->currentNodeRead += $read;
if (feof($this->currentStream)) {
+ $streamStat = fstat($this->currentStream);
fclose($this->currentStream);
$currentNodeSize = $this->nodes[$this->currentNode]->getSize();
if ($this->currentNodeRead < $currentNodeSize) {
- throw new \Exception('Stream from assembly node shorter than expected, got ' . $this->currentNodeRead . ' bytes, expected ' . $currentNodeSize);
+ throw new \Exception('Stream from assembly node shorter than expected, got ' .
+ $this->currentNodeRead . ' bytes, node size is reported as ' .
+ $currentNodeSize . 'B, stream is reported as ' . $streamStat['size'] . 'B'
+ );
}
$this->currentNode++;
$this->currentNodeRead = 0;