[Pkg-owncloud-commits] [owncloud] 16/111: only update file cache if the file is already indexed to avoid that we create a incomplete file cache entry
David Prévot
taffit at moszumanska.debian.org
Wed Nov 20 21:38:35 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 e2fb8d7128d0022406d3cc22cda0439acb599f09
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date: Tue Nov 12 15:55:59 2013 +0100
only update file cache if the file is already indexed to avoid that we create a incomplete file cache entry
---
apps/files_encryption/lib/stream.php | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index 5ce5caf..6e2b2ce 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -67,6 +67,7 @@ class Stream {
* @var \OC\Files\View
*/
private $rootView; // a fsview object set to '/'
+
/**
* @var \OCA\Encryption\Session
*/
@@ -528,20 +529,22 @@ class Stream {
\OC_FileProxy::$enabled = $proxyStatus;
}
+ // we need to update the file info for the real file, not for the
+ // part file.
+ $path = Helper::fixPartialFilePath($this->rawPath);
+
// get file info
- $fileInfo = $this->rootView->getFileInfo($this->rawPath);
- if (!is_array($fileInfo)) {
- $fileInfo = array();
+ $fileInfo = $this->rootView->getFileInfo($path);
+ if (is_array($fileInfo)) {
+ // set encryption data
+ $fileInfo['encrypted'] = true;
+ $fileInfo['size'] = $this->size;
+ $fileInfo['unencrypted_size'] = $this->unencryptedSize;
+
+ // set fileinfo
+ $this->rootView->putFileInfo($path, $fileInfo);
}
- // set encryption data
- $fileInfo['encrypted'] = true;
- $fileInfo['size'] = $this->size;
- $fileInfo['unencrypted_size'] = $this->unencryptedSize;
-
- // set fileinfo
- $this->rootView->putFileInfo($this->rawPath, $fileInfo);
-
}
return fclose($this->handle);
--
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