Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: clean code with helper function dump_header_if_nonempty #18979

Merged
merged 1 commit into from
Nov 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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