don't call getFileInfo() to avoid to open the same file twice

This commit is contained in:
Bjoern Schiessle 2014-03-31 12:43:38 +02:00
parent 8ebb1f15d3
commit aa867ad647
1 changed files with 15 additions and 11 deletions

View File

@ -568,21 +568,25 @@ class Stream {
// part file.
$path = Helper::stripPartialFileExtension($this->rawPath);
// get file info
$fileInfo = $this->rootView->getFileInfo($path);
if ($fileInfo) {
// set encryption data
$fileInfo['encrypted'] = true;
$fileInfo['size'] = $this->size;
$fileInfo['unencrypted_size'] = $this->unencryptedSize;
$fileInfo = array(
'encrypted' => true,
'size' => $this->size,
'unencrypted_size' => $this->unencryptedSize,
);
// set fileinfo
$this->rootView->putFileInfo($path, $fileInfo);
}
}
return fclose($this->handle);
$result = fclose($this->handle);
if ($result === false) {
\OCP\Util::writeLog('Encryption library', 'Could not close stream, file could be corrupted', \OCP\Util::FATAL);
}
return $result;
}
}