Browse Source
Merge pull request #3263 from kmlebedev/fix_pagination
fix pagination
pull/3266/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
16 additions and
13 deletions
-
weed/s3api/s3api_objects_list_handlers.go
|
|
@ -254,8 +254,12 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d |
|
|
|
sepIndex := strings.Index(marker, "/") |
|
|
|
if sepIndex != -1 { |
|
|
|
subPrefix, subMarker := marker[0:sepIndex], marker[sepIndex+1:] |
|
|
|
subDir := fmt.Sprintf("%s/%s", dir[0:bucketPrefixLen-1], subPrefix) |
|
|
|
if strings.HasPrefix(subDir, dir) { |
|
|
|
var subDir string |
|
|
|
if len(dir) > bucketPrefixLen && dir[bucketPrefixLen:] == subPrefix { |
|
|
|
subDir = dir |
|
|
|
} else { |
|
|
|
subDir = fmt.Sprintf("%s/%s", dir, subPrefix) |
|
|
|
} |
|
|
|
subCounter, subIsTruncated, subNextMarker, subErr := s3a.doListFilerEntries(client, subDir, "", maxKeys, subMarker, delimiter, false, false, bucketPrefixLen, eachEntryFn) |
|
|
|
if subErr != nil { |
|
|
|
err = subErr |
|
|
@ -269,7 +273,6 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d |
|
|
|
marker = subPrefix |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if maxKeys <= 0 { |
|
|
|
return |
|
|
|
} |
|
|
|