summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/ObjectStore
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-04-18 21:04:27 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2019-04-18 21:04:27 +0200
commitdedb84acb0f4627175fb1689519fc4fe6eb4c023 (patch)
treec1a9655bde726034a4bc002e9cdea105d410bb00 /lib/private/Files/ObjectStore
parent48821ed6a60ba6df9f88b65276aaf8d808ee15f2 (diff)
downloadnextcloud-server-dedb84acb0f4627175fb1689519fc4fe6eb4c023.tar.gz
nextcloud-server-dedb84acb0f4627175fb1689519fc4fe6eb4c023.zip
Always use a temp file for swift writes
Apparently the if statement doesn't work in all cases (even if I could not reproduce it). So for the time being we will just not directly stream to swift. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Files/ObjectStore')
-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,