XL/PutObject: Calculate size if not provided by the client and update xl.json with the correct size. (#1844)

This commit is contained in:
Krishna Srinivas
2016-06-03 05:39:47 +05:30
committed by Harshavardhana
parent fb95c1fad3
commit b00ac40c35
3 changed files with 14 additions and 9 deletions

View File

@@ -337,11 +337,13 @@ func (xl xlObjects) putObjectPart(bucket string, object string, uploadID string,
}
// Erasure code data and write across all disks.
newEInfos, err := erasureCreateFile(onlineDisks, minioMetaBucket, tmpPartPath, partSuffix, teeReader, eInfos)
newEInfos, n, err := erasureCreateFile(onlineDisks, minioMetaBucket, tmpPartPath, partSuffix, teeReader, eInfos)
if err != nil {
return "", toObjectErr(err, minioMetaBucket, tmpPartPath)
}
if size == -1 {
size = n
}
// Calculate new md5sum.
newMD5Hex := hex.EncodeToString(md5Writer.Sum(nil))
if md5Hex != "" {