Browse Source

a little optimization

pull/2050/head
Chris Lu 4 years ago
parent
commit
c899bdf063
  1. 4
      weed/server/filer_server_handlers_write_upload.go

4
weed/server/filer_server_handlers_write_upload.go

@ -72,11 +72,13 @@ func (fs *FilerServer) uploadReaderToChunks(w http.ResponseWriter, r *http.Reque
if uploadResult.Size == 0 {
break
}
if chunkOffset == 0 {
uploadedMd5 := util.Base64Md5ToBytes(uploadResult.ContentMd5)
readedMd5 := md5Hash.Sum(nil)
if !bytes.Equal(uploadedMd5, readedMd5) && chunkOffset == 0 {
if !bytes.Equal(uploadedMd5, readedMd5) {
glog.Errorf("md5 %x does not match %x uploaded chunk %s to the volume server", readedMd5, uploadedMd5, uploadResult.Name)
}
}
// Save to chunk manifest structure
fileChunks = append(fileChunks, uploadResult.ToPbFileChunk(fileId, chunkOffset))

Loading…
Cancel
Save