[Pkg-owncloud-commits] [owncloud] 99/111: Fix for extstorage + encryption where unencrypted size is not kept
David Prévot
taffit at moszumanska.debian.org
Wed Nov 20 21:38:47 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit fe440248683fb74d758dd257272efcffb7e3c325
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Wed Nov 20 16:20:21 2013 +0100
Fix for extstorage + encryption where unencrypted size is not kept
Fix for external storage with encryption where the unencrypted size is
first written in the DB, then set back to zero, causing performance
issue because the file needs to be reopened every time to find out the
unencrypted size (and potentially needs a full redownload)
---
apps/files_encryption/lib/proxy.php | 3 +++
apps/files_encryption/lib/stream.php | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 54c3b9c..a8c74bd 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -349,7 +349,10 @@ class Proxy extends \OC_FileProxy {
$fileInfo = false;
// get file info from database/cache if not .part file
if (!Helper::isPartialFilePath($path)) {
+ $proxyState = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
$fileInfo = $view->getFileInfo($path);
+ \OC_FileProxy::$enabled = $proxyState;
}
// if file is encrypted return real file size
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 1738955..1f4f14d 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -491,7 +491,8 @@ class Stream {
if (
$this->meta['mode'] !== 'r' &&
$this->meta['mode'] !== 'rb' &&
- $this->size > 0
+ $this->size > 0 &&
+ $this->unencryptedSize > 0
) {
// only write keyfiles if it was a new file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list