fixes #5367

remotes/origin/stable6
Thomas Müller 12 years ago
parent 76be7cd1ac
commit d2d2c9a46d
  1. 2
      lib/private/connector/sabre/file.php
  2. 10
      lib/private/filechunking.php

@ -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);
}

@ -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];

Loading…
Cancel
Save