]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
For range requests, let the range be dumped before the error is honored. 10207/head
authorroot <root@ceph-node1.homeoffice.wal-mart.com>
Wed, 27 Jul 2016 12:35:50 +0000 (18:05 +0530)
committerroot <root@ceph-node1.homeoffice.wal-mart.com>
Mon, 1 Aug 2016 15:22:45 +0000 (20:52 +0530)
Signed-off-by: Pavan Rallabhandi <PRallabhandi@walmartlabs.com>
src/rgw/rgw_rest.cc
src/rgw/rgw_rest_swift.cc

index 588344f88792d4c63f018772bf5e0c0676c82f10..fc5b2f9c8e8e214c37d3a4acd3722422e8f26f0b 100644 (file)
@@ -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);
index dc803265f78bccef902cacf61b6cad73ff7fca18..bf7989f0dbce087f1124c01ddcfe73202dda921a 100644 (file)
@@ -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);
   {