Browse Source

fix pagination

pull/3263/head
Konstantin Lebedev 3 years ago
parent
commit
3d5f1cbc5e
  1. 9
      weed/s3api/s3api_objects_list_handlers.go

9
weed/s3api/s3api_objects_list_handlers.go

@ -254,8 +254,12 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
sepIndex := strings.Index(marker, "/") sepIndex := strings.Index(marker, "/")
if sepIndex != -1 { if sepIndex != -1 {
subPrefix, subMarker := marker[0:sepIndex], marker[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) subCounter, subIsTruncated, subNextMarker, subErr := s3a.doListFilerEntries(client, subDir, "", maxKeys, subMarker, delimiter, false, false, bucketPrefixLen, eachEntryFn)
if subErr != nil { if subErr != nil {
err = subErr err = subErr
@ -269,7 +273,6 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
marker = subPrefix marker = subPrefix
} }
} }
}
if maxKeys <= 0 { if maxKeys <= 0 {
return return
} }

Loading…
Cancel
Save