From 6e999f1176aa02c215c01e79a24b6e993786d566 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 7 Nov 2021 12:39:36 -0800 Subject: [PATCH] s3: fix ListObject if more than 10000 objects --- weed/s3api/s3api_objects_list_handlers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/s3api/s3api_objects_list_handlers.go b/weed/s3api/s3api_objects_list_handlers.go index 6c68e5e68..20ab1d4d6 100644 --- a/weed/s3api/s3api_objects_list_handlers.go +++ b/weed/s3api/s3api_objects_list_handlers.go @@ -220,12 +220,16 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d err = subErr return } + counter += subCounter isTruncated = isTruncated || subIsTruncated maxKeys -= subCounter nextMarker = subDir + "/" + subNextMarker // finished processing this sub directory marker = subDir } + if maxKeys <= 0 { + return + } // now marker is also a direct child of dir request := &filer_pb.ListEntriesRequest{