marker, read_count, should_get_stats());
if (!started) {
- send_response_begin();
+ send_response_begin(buckets.count() > 0);
started = true;
}
send_end:
if (!started) {
- send_response_begin();
+ send_response_begin(false);
}
send_response_end();
}
void execute();
virtual int get_params() = 0;
- virtual void send_response_begin() = 0;
+ virtual void send_response_begin(bool has_buckets) = 0;
virtual void send_response_data(RGWUserBuckets& buckets) = 0;
virtual void send_response_end() = 0;
virtual void send_response() {}
return 0;
}
-void RGWListBuckets_ObjStore_S3::send_response_begin()
+void RGWListBuckets_ObjStore_S3::send_response_begin(bool has_buckets)
{
if (ret)
set_req_state_err(s, ret);
~RGWListBuckets_ObjStore_S3() {}
int get_params() { return 0; }
- virtual void send_response_begin();
+ virtual void send_response_begin(bool has_buckets);
virtual void send_response_data(RGWUserBuckets& buckets);
virtual void send_response_end();
};
return 0;
}
-void RGWListBuckets_ObjStore_SWIFT::send_response_begin()
+void RGWListBuckets_ObjStore_SWIFT::send_response_begin(bool has_buckets)
{
- if (ret)
+ if (ret) {
+ set_req_state_err(s, ret);
+ } else if (!has_buckets && s->format == RGW_FORMAT_PLAIN) {
+ ret = STATUS_NO_CONTENT;
set_req_state_err(s, ret);
+ }
dump_errno(s);
end_header(s);
~RGWListBuckets_ObjStore_SWIFT() {}
int get_params();
- void send_response_begin();
+ void send_response_begin(bool has_buckets);
void send_response_data(RGWUserBuckets& buckets);
void send_response_end();