diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-15 09:32:47 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-15 09:32:47 -0700 |
| commit | c647deace16ec1a3f0c11d92dc5fa15ec30012e4 (patch) | |
| tree | 7b13546507283b5566a069d03dc3371ccd2d7290 /weed/s3api | |
| parent | c03bb180eb5fc96e79324f0aa5ec7cd9b674f901 (diff) | |
| download | seaweedfs-c647deace16ec1a3f0c11d92dc5fa15ec30012e4.tar.xz seaweedfs-c647deace16ec1a3f0c11d92dc5fa15ec30012e4.zip | |
file size support set file length
use Attr.FileSize and TotalChunkSize to determine file size
Diffstat (limited to 'weed/s3api')
| -rw-r--r-- | weed/s3api/filer_multipart.go | 2 | ||||
| -rw-r--r-- | weed/s3api/s3api_objects_list_handlers.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/weed/s3api/filer_multipart.go b/weed/s3api/filer_multipart.go index 31ac850b1..24bbafe1d 100644 --- a/weed/s3api/filer_multipart.go +++ b/weed/s3api/filer_multipart.go @@ -208,7 +208,7 @@ func (s3a *S3ApiServer) listObjectParts(input *s3.ListPartsInput) (output *ListP output.Parts = append(output.Parts, &s3.Part{ PartNumber: aws.Int64(int64(partNumber)), LastModified: aws.Time(time.Unix(entry.Attributes.Mtime, 0).UTC()), - Size: aws.Int64(int64(filer2.TotalSize(entry.Chunks))), + Size: aws.Int64(int64(filer2.FileSize(entry))), ETag: aws.String("\"" + filer2.ETag(entry) + "\""), }) } diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index 311442551..46d5b90c7 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -141,7 +141,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m Key: fmt.Sprintf("%s%s", dir[len(bucketPrefix):], entry.Name), LastModified: time.Unix(entry.Attributes.Mtime, 0).UTC(), ETag: "\"" + filer2.ETag(entry) + "\"", - Size: int64(filer2.TotalSize(entry.Chunks)), + Size: int64(filer2.FileSize(entry)), Owner: CanonicalUser{ ID: fmt.Sprintf("%x", entry.Attributes.Uid), DisplayName: entry.Attributes.UserName, |
