}
}
- while (truncated && count < max) {
+ while (truncated && count <= max) {
if (skip_after_delim > cur_marker) {
cur_marker = skip_after_delim;
ldout(cct, 20) << "setting cur_marker=" << cur_marker << dendl;
}
std::map<string, RGWObjEnt> ent_map;
- int r = cls_bucket_list(bucket, cur_marker, cur_prefix, max - count, ent_map,
+ int r = cls_bucket_list(bucket, cur_marker, cur_prefix, max + 1 - count, ent_map,
&truncated, &cur_marker);
if (r < 0)
return r;
continue;
}
- if (next_marker) {
+ if (next_marker && count < max) {
*next_marker = obj;
}
string prefix_key = obj.substr(0, delim_pos + 1);
if (common_prefixes.find(prefix_key) == common_prefixes.end()) {
+ if (count >= max) {
+ truncated = true;
+ goto done;
+ }
if (next_marker) {
*next_marker = prefix_key;
}
}
}
+ if (count >= max) {
+ truncated = true;
+ goto done;
+ }
+
RGWObjEnt ent = eiter->second;
ent.name = obj;
ent.ns = ns;