Skip to content

Commit

Permalink
Merge pull request ceph#3795 from rzarzynski/wip-10938
Browse files Browse the repository at this point in the history
rgw: improve support for X-Timestamp header of Swift API

Reviewed-by: Yehuda Sadeh <[email protected]>
  • Loading branch information
yehudasa committed Mar 9, 2015
2 parents ea7fbdb + e54fef9 commit a22a63d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rgw/rgw_rest_swift.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ void RGWListBucket_ObjStore_SWIFT::send_response()
static void dump_container_metadata(struct req_state *s, RGWBucketEnt& bucket)
{
char buf[32];
/* Adding X-Timestamp to keep align with Swift API */
snprintf(buf, sizeof(buf), "%lld.00000", (long long)s->bucket_info.creation_time);
s->cio->print("X-Timestamp: %s\r\n", buf);
snprintf(buf, sizeof(buf), "%lld", (long long)bucket.count);
s->cio->print("X-Container-Object-Count: %s\r\n", buf);
snprintf(buf, sizeof(buf), "%lld", (long long)bucket.size);
Expand Down Expand Up @@ -621,7 +624,7 @@ int RGWGetObj_ObjStore_SWIFT::send_response_data(bufferlist& bl, off_t bl_ofs, o

dump_content_length(s, total_len);
dump_last_modified(s, lastmod);
s->cio->print("X-Timestamp: %lld\r\n", (long long)lastmod);
s->cio->print("X-Timestamp: %lld.00000\r\n", (long long)lastmod);

if (!ret) {
map<string, bufferlist>::iterator iter = attrs.find(RGW_ATTR_ETAG);
Expand Down

0 comments on commit a22a63d

Please sign in to comment.