Merge pull request #11736 from owncloud/enc_get_fileinfo_from_real_file

if we read a .part file we try to get the file info from the real file
This commit is contained in:
Björn Schießle 2014-11-07 16:20:42 +01:00
commit 68a522a8fa
4 changed files with 14 additions and 10 deletions

View File

@ -345,8 +345,8 @@ class Proxy extends \OC_FileProxy {
return $size;
}
// get file info from database/cache if not .part file
if (empty($fileInfo) && !Helper::isPartialFilePath($path)) {
// get file info from database/cache
if (empty($fileInfo)) {
$proxyState = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$fileInfo = $view->getFileInfo($path);

View File

@ -637,13 +637,17 @@ class Stream {
$path = Helper::stripPartialFileExtension($this->rawPath);
$fileInfo = array(
'mimetype' => $this->rootView->getMimeType($this->rawPath),
'encrypted' => true,
'size' => $this->size,
'unencrypted_size' => $this->unencryptedSize,
);
// set fileinfo
// if we write a part file we also store the unencrypted size for
// the part file so that it can be re-used later
$this->rootView->putFileInfo($this->rawPath, $fileInfo);
if ($path !== $this->rawPath) {
$this->rootView->putFileInfo($path, $fileInfo);
}
}

View File

@ -902,7 +902,7 @@ class View {
$scanner = $storage->getScanner($internalPath);
$scanner->scan($internalPath, Cache\Scanner::SCAN_SHALLOW);
$data = $cache->get($internalPath);
} else if ($watcher->checkUpdate($internalPath, $data)) {
} else if (!Cache\Scanner::isPartialFile($internalPath) && $watcher->checkUpdate($internalPath, $data)) {
$this->updater->propagate($path);
$data = $cache->get($internalPath);
}