|
|
@ -99,13 +99,10 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa |
|
|
|
|
|
|
|
for _, entry := range entries { |
|
|
|
if strings.HasSuffix(entry.Name, ".part") && !entry.IsDirectory { |
|
|
|
partETag, isFirstPart, found := findByPartNumber(entry.Name, completedParts) |
|
|
|
partETag, found := findByPartNumber(entry.Name, completedParts) |
|
|
|
if !found { |
|
|
|
continue |
|
|
|
} |
|
|
|
if isFirstPart { |
|
|
|
mime = entry.GetAttributes().Mime |
|
|
|
} |
|
|
|
entryETag := hex.EncodeToString(entry.Attributes.GetMd5()) |
|
|
|
if partETag != "" && len(partETag) == 32 && entryETag != "" && entryETag != partETag { |
|
|
|
glog.Errorf("completeMultipartUpload %s ETag mismatch chunk: %s part: %s", entry.Name, entryETag, partETag) |
|
|
@ -179,7 +176,7 @@ func (s3a *S3ApiServer) completeMultipartUpload(input *s3.CompleteMultipartUploa |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func findByPartNumber(fileName string, parts []CompletedPart) (etag string, firstPart, found bool) { |
|
|
|
func findByPartNumber(fileName string, parts []CompletedPart) (etag string, found bool) { |
|
|
|
partNumber, formatErr := strconv.Atoi(fileName[:4]) |
|
|
|
if formatErr != nil { |
|
|
|
return |
|
|
@ -201,7 +198,7 @@ func findByPartNumber(fileName string, parts []CompletedPart) (etag string, firs |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
return parts[x+y].ETag, partNumber == 1, true |
|
|
|
return parts[x+y].ETag, true |
|
|
|
} |
|
|
|
|
|
|
|
func (s3a *S3ApiServer) abortMultipartUpload(input *s3.AbortMultipartUploadInput) (output *s3.AbortMultipartUploadOutput, code s3err.ErrorCode) { |
|
|
|