Use streams when generating hashes of remote files

This commit is contained in:
Robin Appelman 2014-03-20 15:35:01 +01:00 committed by Andreas Fischer
parent 70db348475
commit 54a15a8001
1 changed files with 5 additions and 3 deletions

View File

@ -159,9 +159,11 @@ abstract class Common implements \OC\Files\Storage\Storage {
}
public function hash($type, $path, $raw = false) {
$tmpFile = $this->getLocalFile($path);
$hash = hash_file($type, $tmpFile, $raw);
return $hash;
$fh = $this->fopen($path, 'r');
$ctx = hash_init($type);
hash_update_stream($ctx, $fh);
fclose($fh);
return hash_final($ctx, $raw);
}
public function search($query) {