summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-04-24 09:00:17 +0200
committerGitHub <noreply@github.com>2019-04-24 09:00:17 +0200
commit402930521aab4bc1df74cf628faef3685bd45492 (patch)
tree026a1b2dbfe7913b0ff89876a87b55f35f87e491
parent201fc9fbcffaf2607f222e6f1ced157dd3e4b709 (diff)
parentdedb84acb0f4627175fb1689519fc4fe6eb4c023 (diff)
downloadnextcloud-server-402930521aab4bc1df74cf628faef3685bd45492.tar.gz
nextcloud-server-402930521aab4bc1df74cf628faef3685bd45492.zip
Merge pull request #15168 from nextcloud/fix/13554/always_tmpfile_for_swift
Always use a temp file for swift writes
-rw-r--r--lib/private/Files/ObjectStore/Swift.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php
index 7e4654b6eb2..fd416157635 100644
--- a/lib/private/Files/ObjectStore/Swift.php
+++ b/lib/private/Files/ObjectStore/Swift.php
@@ -76,14 +76,9 @@ class Swift implements IObjectStore {
* @throws \Exception from openstack lib when something goes wrong
*/
public function writeObject($urn, $stream) {
- $handle = $stream;
-
- $meta = stream_get_meta_data($stream);
- if (!(isset($meta['seekable']) && $meta['seekable'] === true)) {
- $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('swiftwrite');
- file_put_contents($tmpFile, $stream);
- $handle = fopen($tmpFile, 'rb');
- }
+ $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('swiftwrite');
+ file_put_contents($tmpFile, $stream);
+ $handle = fopen($tmpFile, 'rb');
$this->getContainer()->createObject([
'name' => $urn,