mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
Merge pull request #756 from harshavardhana/pr_out_fix_a_crash_during_listobjects_populating_nextmarker
Fix a crash during listObjects() populating NextMarker
This commit is contained in:
commit
49c705da99
@ -545,9 +545,6 @@ func (donut API) ListObjects(bucket string, resources BucketResourcesMetadata, s
|
|||||||
}
|
}
|
||||||
resources.CommonPrefixes = listObjects.CommonPrefixes
|
resources.CommonPrefixes = listObjects.CommonPrefixes
|
||||||
resources.IsTruncated = listObjects.IsTruncated
|
resources.IsTruncated = listObjects.IsTruncated
|
||||||
if resources.IsTruncated && resources.Delimiter != "" {
|
|
||||||
resources.NextMarker = results[len(results)-1].Object
|
|
||||||
}
|
|
||||||
for key := range listObjects.Objects {
|
for key := range listObjects.Objects {
|
||||||
keys = append(keys, key)
|
keys = append(keys, key)
|
||||||
}
|
}
|
||||||
@ -555,6 +552,9 @@ func (donut API) ListObjects(bucket string, resources BucketResourcesMetadata, s
|
|||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
results = append(results, listObjects.Objects[key])
|
results = append(results, listObjects.Objects[key])
|
||||||
}
|
}
|
||||||
|
if resources.IsTruncated && resources.Delimiter != "" {
|
||||||
|
resources.NextMarker = results[len(results)-1].Object
|
||||||
|
}
|
||||||
return results, resources, nil
|
return results, resources, nil
|
||||||
}
|
}
|
||||||
storedBucket := donut.storedBuckets.Get(bucket).(storedBucket)
|
storedBucket := donut.storedBuckets.Get(bucket).(storedBucket)
|
||||||
|
Loading…
Reference in New Issue
Block a user