s3: fix multipart upload uploading 0 length files

This regression was introduced by the recent re-write of the s3
multipart upload code.
s3-about
Nick Craig-Wood 2020-01-05 11:24:15 +00:00
parent ad2bb86d8c
commit 7242c7ce95
1 changed files with 1 additions and 1 deletions

View File

@ -2127,7 +2127,7 @@ func (o *Object) uploadMultipart(ctx context.Context, req *s3.PutObjectInput, si
var n int
n, err = readers.ReadFill(in, buf) // this can never return 0, nil
if err == io.EOF {
if n == 0 {
if n == 0 && partNum != 1 { // end if no data and if not first chunk
break
}
finished = true