summaryrefslogtreecommitdiffstats
path: root/lib/private/files
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files')
-rw-r--r--lib/private/files/cache/watcher.php4
-rw-r--r--lib/private/files/storage/wrapper/quota.php2
-rw-r--r--lib/private/files/view.php7
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/files/cache/watcher.php b/lib/private/files/cache/watcher.php
index 58f624c8990..251ecbe7071 100644
--- a/lib/private/files/cache/watcher.php
+++ b/lib/private/files/cache/watcher.php
@@ -40,7 +40,7 @@ class Watcher {
* check $path for updates
*
* @param string $path
- * @return boolean true if path was updated, false otherwise
+ * @return boolean | array true if path was updated, otherwise the cached data is returned
*/
public function checkUpdate($path) {
$cachedEntry = $this->cache->get($path);
@@ -56,7 +56,7 @@ class Watcher {
$this->cache->correctFolderSize($path);
return true;
}
- return false;
+ return $cachedEntry;
}
/**
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php
index 43016e0892f..a430e3e4617 100644
--- a/lib/private/files/storage/wrapper/quota.php
+++ b/lib/private/files/storage/wrapper/quota.php
@@ -95,7 +95,7 @@ class Quota extends Wrapper {
public function fopen($path, $mode) {
$source = $this->storage->fopen($path, $mode);
$free = $this->free_space('');
- if ($free >= 0 && $mode !== 'r') {
+ if ($source && $free >= 0 && $mode !== 'r' && $mode !== 'rb') {
return \OC\Files\Stream\Quota::wrap($source, $free);
} else {
return $source;
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index b5870279664..6fc534757b2 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -794,6 +794,7 @@ class View {
* @var string $internalPath
*/
list($storage, $internalPath) = Filesystem::resolvePath($path);
+ $data = null;
if ($storage) {
$cache = $storage->getCache($internalPath);
$permissionsCache = $storage->getPermissionsCache($internalPath);
@@ -804,10 +805,12 @@ class View {
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
} else {
$watcher = $storage->getWatcher($internalPath);
- $watcher->checkUpdate($internalPath);
+ $data = $watcher->checkUpdate($internalPath);
}
- $data = $cache->get($internalPath);
+ if (!is_array($data)) {
+ $data = $cache->get($internalPath);
+ }
if ($data and $data['fileid']) {
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {