1
0
mirror of https://github.com/ceph/ceph synced 2025-03-30 15:31:01 +00:00

rgw: fix swift responses encoding

This commit is contained in:
Yehuda Sadeh 2011-11-14 13:55:09 -08:00
parent 2445fd8416
commit 1fe16923b4

View File

@ -42,7 +42,7 @@ void RGWListBuckets_REST_SWIFT::send_response()
for (int i = 0; i < limit && iter != m.end(); ++iter, ++i) {
RGWBucketEnt obj = iter->second;
s->formatter->open_object_section("container");
s->formatter->dump_format("name", obj.bucket.name.c_str());
s->formatter->dump_string("name", obj.bucket.name.c_str());
s->formatter->dump_int("count", obj.count);
s->formatter->dump_int("bytes", obj.size);
s->formatter->close_section();
@ -130,8 +130,8 @@ void RGWListBucket_REST_SWIFT::send_response()
goto next;
s->formatter->open_object_section("object");
s->formatter->dump_format("name", iter->name.c_str());
s->formatter->dump_format("hash", "\"%s\"", iter->etag.c_str());
s->formatter->dump_string("name", iter->name.c_str());
s->formatter->dump_string("hash", iter->etag.c_str());
s->formatter->dump_int("bytes", iter->size);
string single_content_type = iter->content_type;
if (iter->content_type.size()) {
@ -143,7 +143,7 @@ void RGWListBucket_REST_SWIFT::send_response()
++pos;
single_content_type = single_content_type.substr(pos);
}
s->formatter->dump_format("content_type", single_content_type.c_str());
s->formatter->dump_string("content_type", single_content_type.c_str());
}
dump_time(s, "last_modified", &iter->mtime);
s->formatter->close_section();
@ -155,7 +155,7 @@ void RGWListBucket_REST_SWIFT::send_response()
goto next;
s->formatter->open_object_section("object");
s->formatter->dump_format("name", pref_iter->first.c_str());
s->formatter->dump_string("name", pref_iter->first.c_str());
s->formatter->close_section();
}
next: