diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-10-11 15:34:27 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-10-11 15:34:27 +0200 |
commit | 214a50d071722d18e60dc1cd4f8bac780abed8ec (patch) | |
tree | 3ef5cfe2158580790aacdbe054117741150ab46c | |
parent | 94ded147241d76438e9104395f63bc7b9607ccf3 (diff) | |
download | nextcloud-server-214a50d071722d18e60dc1cd4f8bac780abed8ec.tar.gz nextcloud-server-214a50d071722d18e60dc1cd4f8bac780abed8ec.zip |
Avoid allocating too much memory for the buffer
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | lib/private/Files/ObjectStore/S3ObjectTrait.php | 2 |
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 |