Skip to content

Commit

Permalink
Merge pull request ceph#18979 from cfanz/dump-header-improve-wip
Browse files Browse the repository at this point in the history
rgw: clean code with helper function dump_header_if_nonempty
Reviewed-by: Casey Bodley <[email protected]>
  • Loading branch information
oritwas authored Nov 20, 2017
2 parents c0e4426 + b889879 commit aa271b5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/rgw/rgw_rest_s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,7 @@ int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs,

dump_content_length(s, total_len);
dump_last_modified(s, lastmod);
if (!version_id.empty()) {
dump_header(s, "x-amz-version-id", version_id);
}

dump_header_if_nonempty(s, "x-amz-version-id", version_id);

if (! op_ret) {
if (! lo_etag.empty()) {
Expand Down Expand Up @@ -2042,9 +2039,7 @@ void RGWDeleteObj_ObjStore_S3::send_response()

set_req_state_err(s, r);
dump_errno(s);
if (!version_id.empty()) {
dump_header(s, "x-amz-version-id", version_id);
}
dump_header_if_nonempty(s, "x-amz-version-id", version_id);
if (delete_marker) {
dump_header(s, "x-amz-delete-marker", "true");
}
Expand Down

0 comments on commit aa271b5

Please sign in to comment.