mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #34552 from nextcloud/backport/34537/stable24
[stable24] Avoid allocating too much memory for the buffer on s3 uploads
This commit is contained in:
commit
955bd21f7b
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue