mirror of
https://github.com/chrislusf/seaweedfs
synced 2024-09-19 07:21:00 +02:00
Fix s3api_object_list_handlers returning contents less than the specified limit when more data actually exists (#4240)
Fix when the stored data is actually enough but s3api_object_list_handlers returns less than the specified limit Signed-off-by: changlin.shi <changlin.shi@ly.com>
This commit is contained in:
parent
ef2f741823
commit
db5515eada
|
@ -146,8 +146,10 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
|
|||
|
||||
// check filer
|
||||
err = s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
||||
for {
|
||||
empty := true
|
||||
nextMarker, doErr = s3a.doListFilerEntries(client, reqDir, prefix, cursor, marker, delimiter, false, func(dir string, entry *filer_pb.Entry) {
|
||||
empty = false
|
||||
if entry.IsDirectory {
|
||||
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html
|
||||
if delimiter == "/" { // A response can contain CommonPrefixes only if you specify a delimiter.
|
||||
|
@ -192,12 +194,18 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
|
|||
return doErr
|
||||
}
|
||||
|
||||
if !cursor.isTruncated {
|
||||
nextMarker = ""
|
||||
} else {
|
||||
if cursor.isTruncated {
|
||||
if requestDir != "" {
|
||||
nextMarker = requestDir + "/" + nextMarker
|
||||
}
|
||||
break
|
||||
} else if empty {
|
||||
nextMarker = ""
|
||||
break
|
||||
} else {
|
||||
// start next loop
|
||||
marker = nextMarker
|
||||
}
|
||||
}
|
||||
|
||||
response = ListBucketResult{
|
||||
|
|
Loading…
Reference in a new issue