diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-24 00:56:46 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-24 00:56:46 -0700 |
commit | 808e9b0f515585f8d2bb18de94eed994d14f3749 (patch) | |
tree | 15dc4d4688440e7c87193f14fb91185d1f40d9c5 | |
parent | db70b18c1d042bac1a9bca50c383654d728ff0c8 (diff) | |
parent | d2d2c9a46d86be2b38d6e88c1943e7328ebb26d3 (diff) | |
download | nextcloud-server-808e9b0f515585f8d2bb18de94eed994d14f3749.tar.gz nextcloud-server-808e9b0f515585f8d2bb18de94eed994d14f3749.zip |
Merge pull request #5402 from owncloud/fixing-5367-master
fixes chunked upload
-rw-r--r-- | lib/private/connector/sabre/file.php | 2 | ||||
-rw-r--r-- | lib/private/filechunking.php | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 0fa5e0b0528..919bb1fc6f4 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -222,7 +222,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D if (isset($_SERVER['CONTENT_LENGTH'])) { $expected = $_SERVER['CONTENT_LENGTH']; if ($bytesWritten != $expected) { - $chunk_handler->cleanup(); + $chunk_handler->remove($info['index']); throw new Sabre_DAV_Exception_BadRequest( 'expected filesize ' . $expected . ' got ' . $bytesWritten); } diff --git a/lib/private/filechunking.php b/lib/private/filechunking.php index 0dfce696cda..aa4f73c7c05 100644 --- a/lib/private/filechunking.php +++ b/lib/private/filechunking.php @@ -85,6 +85,16 @@ class OC_FileChunking { } } + /** + * Removes one specific chunk + * @param $index + */ + public function remove($index) { + $cache = $this->getCache(); + $prefix = $this->getPrefix(); + $cache->remove($prefix.$index); + } + public function signature_split($orgfile, $input) { $info = unpack('n', fread($input, 2)); $blocksize = $info[1]; |