Skip to content

Commit 5ce6f65

Browse files
committed
also log stream size when reporting unexpected chunk size
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent b0976e4 commit 5ce6f65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/dav/lib/Upload/AssemblyStream.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,14 @@ public function stream_read($count) {
153153
$this->currentNodeRead += $read;
154154

155155
if (feof($this->currentStream)) {
156+
$streamStat = fstat($this->currentStream);
156157
fclose($this->currentStream);
157158
$currentNodeSize = $this->nodes[$this->currentNode]->getSize();
158159
if ($this->currentNodeRead < $currentNodeSize) {
159-
throw new \Exception('Stream from assembly node shorter than expected, got ' . $this->currentNodeRead . ' bytes, expected ' . $currentNodeSize);
160+
throw new \Exception('Stream from assembly node shorter than expected, got ' .
161+
$this->currentNodeRead . ' bytes, node size is reported as ' .
162+
$currentNodeSize . 'B, stream is reported as ' . $streamStat['size'] . 'B'
163+
);
160164
}
161165
$this->currentNode++;
162166
$this->currentNodeRead = 0;

0 commit comments

Comments
 (0)