Fix incomplete local hashes.

Fixes #533
This commit is contained in:
Klaus Post
2016-06-19 16:51:49 +02:00
parent ab0947ee37
commit e0aa4bb492
2 changed files with 19 additions and 7 deletions
+4 -4
View File
@@ -566,13 +566,13 @@ func (file *localOpenFile) Read(p []byte) (n int, err error) {
return
}
// Close the object and update the md5sum
// Close the object and update the hashes
func (file *localOpenFile) Close() (err error) {
err = file.in.Close()
if err == nil {
file.o.hashes = file.hash.Sums()
} else {
file.o.hashes = nil
if file.hash.Size() == file.o.Size() {
file.o.hashes = file.hash.Sums()
}
}
return err
}