diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index d4c8e94a3..ff7e92304 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -3,6 +3,8 @@ package s3api import ( "bytes" "fmt" + "github.com/seaweedfs/seaweedfs/weed/filer" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "io" "net/http" "net/url" diff --git a/weed/s3api/s3api_object_handlers_list.go b/weed/s3api/s3api_object_handlers_list.go index 70e778270..591e1880b 100644 --- a/weed/s3api/s3api_object_handlers_list.go +++ b/weed/s3api/s3api_object_handlers_list.go @@ -155,7 +155,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m } // This is necessary for SQL request with WHERE `directory` || `name` > originalMarker if len(originalMarker) > 0 && originalMarker[0:1] != "/" { - marker = getStartFileFromKey(originalMarker) + marker = s3a.getStartFileFromKey(originalMarker) } else { marker = originalMarker } @@ -163,7 +163,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m Name: bucket, Prefix: originalPrefix, Marker: originalMarker, - MaxKeys: maxKeys, + MaxKeys: int(maxKeys), Delimiter: delimiter, } if encodingTypeUrl { @@ -183,7 +183,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m defer func() { if cursor.maxKeys == 0 { cursor.isTruncated = true - cursor.nextMarker = getStartFileFromKey(key) + cursor.nextMarker = s3a.getStartFileFromKey(key) } }() if delimiter == "/" { diff --git a/weed/s3api/s3api_object_handlers_list_test.go b/weed/s3api/s3api_object_handlers_list_test.go index 50ef81171..3295c2fca 100644 --- a/weed/s3api/s3api_object_handlers_list_test.go +++ b/weed/s3api/s3api_object_handlers_list_test.go @@ -27,8 +27,7 @@ func TestListObjectsHandler(t *testing.T) { ETag: "\"4397da7a7649e8085de9916c240e8166\"", Size: 1234567, Owner: CanonicalUser{ - ID: "65a011niqo39cdf8ec533ec3d1ccaafsa932", - set: true, + ID: "65a011niqo39cdf8ec533ec3d1ccaafsa932", }, StorageClass: "STANDARD", }}, diff --git a/weed/s3api/s3api_xsd_generated.go b/weed/s3api/s3api_xsd_generated.go index 8e1b63d3f..0b0ba6179 100644 --- a/weed/s3api/s3api_xsd_generated.go +++ b/weed/s3api/s3api_xsd_generated.go @@ -1125,9 +1125,8 @@ type ListBucketResult struct { Prefix string `xml:"Prefix"` Marker string `xml:"Marker"` NextMarker string `xml:"NextMarker,omitempty"` - MaxKeys uint16 `xml:"MaxKeys"` + MaxKeys int `xml:"MaxKeys"` Delimiter string `xml:"Delimiter,omitempty"` - EncodingType string `xml:"EncodingType,omitempty"` IsTruncated bool `xml:"IsTruncated"` Contents []ListEntry `xml:"Contents,omitempty"` CommonPrefixes []PrefixEntry `xml:"CommonPrefixes,omitempty"` @@ -1153,14 +1152,6 @@ func (t *ListEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error { layout.LastModified = (*xsdDateTime)(&layout.T.LastModified) return e.EncodeElement(layout, start) } -func (c CanonicalUser) MarshalXML(e *xml.Encoder, start xml.StartElement) error { - if !c.set { - return nil - } - type canonicalUserWrapper CanonicalUser - return e.EncodeElement(canonicalUserWrapper(c), start) -} - func (t *ListEntry) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { type T ListEntry var overlay struct { diff --git a/weed/server/filer_grpc_server_traverse_meta.go b/weed/server/filer_grpc_server_traverse_meta.go index 4a924f065..6c23b15cc 100644 --- a/weed/server/filer_grpc_server_traverse_meta.go +++ b/weed/server/filer_grpc_server_traverse_meta.go @@ -63,7 +63,7 @@ func (fs *FilerServer) iterateDirectory(ctx context.Context, dirPath util.FullPa var listErr error for { var hasEntries bool - lastFileName, listErr = fs.filer.StreamListDirectoryEntries(ctx, dirPath, lastFileName, false, 1024, "", "", "", func(entry *filer.Entry) bool { + lastFileName, listErr = fs.filer.StreamListDirectoryEntries(ctx, dirPath, lastFileName, false, false, false, 1024, "", "", "", func(entry *filer.Entry) bool { hasEntries = true if fnErr := fn(entry); fnErr != nil { err = fnErr