Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2022-10-12 11:24:55 +0300
committerGitHub <noreply@github.com>2022-10-12 11:24:55 +0300
commitd936694cdbd600c802a4368166f25d2f802235f5 (patch)
treecea9e371451c112b373f744130dcd7012066f313
parent2525f7eb3977e8fe53e61c9cda339ba5fd54593f (diff)
parent214a50d071722d18e60dc1cd4f8bac780abed8ec (diff)
Merge pull request #34537 from nextcloud/bugfix/noid/s3-upload-memory
Avoid allocating too much memory for the buffer on s3 uploads
-rw-r--r--lib/private/Files/ObjectStore/S3ObjectTrait.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php
index 9d692e01a23..a88ebbeda82 100644
--- a/lib/private/Files/ObjectStore/S3ObjectTrait.php
+++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php
@@ -152,7 +152,7 @@ trait S3ObjectTrait {
// ($psrStream->isSeekable() && $psrStream->getSize() !== null) evaluates to true for a On-Seekable stream
// so the optimisation does not apply
$buffer = new Psr7\Stream(fopen("php://memory", 'rwb+'));
- Utils::copyToStream($psrStream, $buffer, $this->uploadPartSize);
+ Utils::copyToStream($psrStream, $buffer, $this->putSizeLimit);
$buffer->seek(0);
if ($buffer->getSize() < $this->putSizeLimit) {
// buffer is fully seekable, so use it directly for the small upload