From fe440248683fb74d758dd257272efcffb7e3c325 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 20 Nov 2013 16:20:21 +0100 Subject: 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/stream.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/files_encryption/lib/stream.php') diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index 1738955d1aa..1f4f14d7fe5 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 -- cgit v1.2.3