mirror of
https://github.com/minio/minio.git
synced 2025-04-14 00:09:52 -04:00
XL/fs: ListMultipartUploads should list only requested entries. (#1668)
Fixes #1665
This commit is contained in:
parent
3c1ef3fee2
commit
404364ba73
@ -373,6 +373,12 @@ func listMetaBucketMultipartFiles(layer ObjectLayer, prefixPath string, markerPa
|
|||||||
}
|
}
|
||||||
fileInfo.Name = path.Join(fi.Name, entry)
|
fileInfo.Name = path.Join(fi.Name, entry)
|
||||||
fileInfos = append(fileInfos, fileInfo)
|
fileInfos = append(fileInfos, fileInfo)
|
||||||
|
newMaxKeys++
|
||||||
|
// If we have reached the maxKeys, it means we have listed
|
||||||
|
// everything that was requested. Return right here.
|
||||||
|
if newMaxKeys == maxKeys {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We reach here for a non-recursive case non-leaf entry
|
// We reach here for a non-recursive case non-leaf entry
|
||||||
@ -385,12 +391,12 @@ func listMetaBucketMultipartFiles(layer ObjectLayer, prefixPath string, markerPa
|
|||||||
fi.Name = path.Dir(fi.Name)
|
fi.Name = path.Dir(fi.Name)
|
||||||
}
|
}
|
||||||
fileInfos = append(fileInfos, fi)
|
fileInfos = append(fileInfos, fi)
|
||||||
}
|
newMaxKeys++
|
||||||
newMaxKeys++
|
// If we have reached the maxKeys, it means we have listed
|
||||||
// If we have reached the maxKeys, it means we have listed
|
// everything that was requested. Return right here.
|
||||||
// everything that was requested. Return right here.
|
if newMaxKeys == maxKeys {
|
||||||
if newMaxKeys == maxKeys {
|
return
|
||||||
return
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,6 +404,12 @@ func listMetaBucketMultipartFiles(layer ObjectLayer, prefixPath string, markerPa
|
|||||||
return fileInfos, eof, nil
|
return fileInfos, eof, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Currently the code sorts based on keyName/upload-id which is
|
||||||
|
// in correct based on the S3 specs. According to s3 specs we are
|
||||||
|
// supposed to only lexically sort keyNames and then for keyNames with
|
||||||
|
// multiple upload ids should be sorted based on the initiated time.
|
||||||
|
// Currently this case is not handled.
|
||||||
|
|
||||||
// listMultipartUploadsCommon - lists all multipart uploads, common
|
// listMultipartUploadsCommon - lists all multipart uploads, common
|
||||||
// function for both object layers.
|
// function for both object layers.
|
||||||
func listMultipartUploadsCommon(layer ObjectLayer, bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, error) {
|
func listMultipartUploadsCommon(layer ObjectLayer, bucket, prefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user