Skip to content

Commit

Permalink
For range requests, let the range be dumped before the error is honored.
Browse files Browse the repository at this point in the history
Signed-off-by: Pavan Rallabhandi <PRallabhandi@walmartlabs.com>
  • Loading branch information
root committed Aug 1, 2016
1 parent 613bc0a commit eae6525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/rgw/rgw_rest.cc
Expand Up @@ -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);
Expand Down
10 changes: 6 additions & 4 deletions src/rgw/rgw_rest_swift.cc
Expand Up @@ -1206,16 +1206,18 @@ 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);
{
utime_t ut(lastmod);
Expand Down

0 comments on commit eae6525

Please sign in to comment.