]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixes #5367
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 17 Oct 2013 18:20:13 +0000 (20:20 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 17 Oct 2013 18:20:13 +0000 (20:20 +0200)
lib/private/connector/sabre/file.php
lib/private/filechunking.php

index 3402946a136b867df5550df582ae8505382c5560..fd12039d91674d30ee0b26ca98fd6069ce57114b 100644 (file)
@@ -215,7 +215,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);
                                }
index 0dfce696cda7a37057bc853e846a5426477ac653..aa4f73c7c05cc00669bbe8fe0391d2d4ea404d9f 100644 (file)
@@ -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];