mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
try fix s3test test_bucket_listv2_delimiter_prefix (#4396)
This commit is contained in:
parent
095cdb0c7f
commit
88b2bbadd1
|
@ -353,7 +353,9 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||||
nextMarker = entry.Name
|
nextMarker = entry.Name
|
||||||
if cursor.prefixEndsOnDelimiter {
|
if cursor.prefixEndsOnDelimiter {
|
||||||
if entry.Name == prefix && entry.IsDirectory {
|
if entry.Name == prefix && entry.IsDirectory {
|
||||||
|
if delimiter != "/" {
|
||||||
cursor.prefixEndsOnDelimiter = false
|
cursor.prefixEndsOnDelimiter = false
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -363,8 +365,12 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||||
if entry.Name == s3_constants.MultipartUploadsFolder { // FIXME no need to apply to all directories. this extra also affects maxKeys
|
if entry.Name == s3_constants.MultipartUploadsFolder { // FIXME no need to apply to all directories. this extra also affects maxKeys
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if delimiter != "/" {
|
if delimiter != "/" || cursor.prefixEndsOnDelimiter {
|
||||||
|
if cursor.prefixEndsOnDelimiter {
|
||||||
|
cursor.prefixEndsOnDelimiter = false
|
||||||
|
} else {
|
||||||
eachEntryFn(dir, entry)
|
eachEntryFn(dir, entry)
|
||||||
|
}
|
||||||
subNextMarker, subErr := s3a.doListFilerEntries(client, dir+"/"+entry.Name, "", cursor, "", delimiter, false, eachEntryFn)
|
subNextMarker, subErr := s3a.doListFilerEntries(client, dir+"/"+entry.Name, "", cursor, "", delimiter, false, eachEntryFn)
|
||||||
if subErr != nil {
|
if subErr != nil {
|
||||||
err = fmt.Errorf("doListFilerEntries2: %v", subErr)
|
err = fmt.Errorf("doListFilerEntries2: %v", subErr)
|
||||||
|
@ -391,6 +397,9 @@ func (s3a *S3ApiServer) doListFilerEntries(client filer_pb.SeaweedFilerClient, d
|
||||||
eachEntryFn(dir, entry)
|
eachEntryFn(dir, entry)
|
||||||
// glog.V(4).Infof("List File Entries %s, file: %s, maxKeys %d", dir, entry.Name, cursor.maxKeys)
|
// glog.V(4).Infof("List File Entries %s, file: %s, maxKeys %d", dir, entry.Name, cursor.maxKeys)
|
||||||
}
|
}
|
||||||
|
if cursor.prefixEndsOnDelimiter {
|
||||||
|
cursor.prefixEndsOnDelimiter = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue