From: root Date: Wed, 27 Jul 2016 12:35:50 +0000 (+0530) Subject: For range requests, let the range be dumped before the error is honored. X-Git-Tag: ses5-milestone5~244^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10207%2Fhead;p=ceph.git For range requests, let the range be dumped before the error is honored. Signed-off-by: Pavan Rallabhandi --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index 588344f88792..fc5b2f9c8e8e 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -655,9 +655,7 @@ void end_header(struct req_state* s, RGWOp* op, const char *content_type, s->formatter->close_section(); } s->formatter->output_footer(); - if (s->obj_size) { - dump_content_length(s, s->formatter->get_len()); - } + dump_content_length(s, s->formatter->get_len()); } else { if (proposed_content_length != NO_CONTENT_LENGTH) { dump_content_length(s, proposed_content_length); diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index dc803265f78b..bf7989f0dbce 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -1206,15 +1206,16 @@ int RGWGetObj_ObjStore_SWIFT::send_response_data(bufferlist& bl, set_req_state_err(s, (partial_content && !op_ret) ? STATUS_PARTIAL_CONTENT : op_ret); dump_errno(s); - if (s->err.is_err()) { - end_header(s, NULL); - return 0; - } if (range_str) { dump_range(s, ofs, end, s->obj_size); } + if (s->err.is_err()) { + end_header(s, NULL); + return 0; + } + dump_content_length(s, total_len); dump_last_modified(s, lastmod); {