[Pkg-owncloud-commits] [owncloud] 04/131: Clean up part file only once, not twice on error
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 15:58:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.1.1
in repository owncloud.
commit 4fff832fa6aa9c054eac4aeecb7eb55a9860343e
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Wed Jul 1 09:30:18 2015 +0200
Clean up part file only once, not twice on error
---
lib/private/connector/sabre/file.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 93244be..c28ac58 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -189,7 +189,6 @@ class File extends Node implements IFile {
}
if (!$run || $renameOkay === false || $fileExists === false) {
\OC_Log::write('webdav', 'renaming part file to final file failed', \OC_Log::ERROR);
- $partStorage->unlink($internalPartPath);
throw new Exception('Could not rename part file to final file');
}
} catch (\Exception $e) {
@@ -350,6 +349,7 @@ class File extends Node implements IFile {
if ($chunk_handler->isComplete()) {
list($storage,) = $this->fileView->resolvePath($path);
$needsPartFile = $this->needsPartFile($storage);
+ $partFile = null;
try {
$targetPath = $path . '/' . $info['name'];
@@ -388,7 +388,7 @@ class File extends Node implements IFile {
$info = $this->fileView->getFileInfo($targetPath);
return $info->getEtag();
} catch (\Exception $e) {
- if ($partFile) {
+ if ($partFile !== null) {
$this->fileView->unlink($partFile);
}
$this->convertToSabreException($e);
--
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