]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #3863 from rzarzynski/wip-10971
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 20 Apr 2015 16:21:24 +0000 (09:21 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 20 Apr 2015 16:21:24 +0000 (09:21 -0700)
rgw: multiple fixes for Content-Length header generation in Swift API

Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
1  2 
src/rgw/rgw_rest.cc
src/rgw/rgw_rest_swift.cc

index 6fbe937331aa4782c3370acab385c7ceaa3447ad,601a265ac144a1c5e7437c1153efbd22ca5c8f64..d3bfca2c946e0969320e73383eee84ef92311a9b
@@@ -529,14 -525,14 +529,18 @@@ void end_header(struct req_state *s, RG
        s->formatter->dump_string("Message", s->err.message);
      s->formatter->close_section();
      dump_content_length(s, s->formatter->get_len());
+   } else {
+     if (proposed_content_length != NO_CONTENT_LENGTH) {
+       dump_content_length(s, proposed_content_length);
+     }
    }
 -  int r = s->cio->print("Content-type: %s\r\n", content_type);
 -  if (r < 0) {
 -    ldout(s->cct, 0) << "ERROR: s->cio->print() returned err=" << r << dendl;
 +
 +  int r;
 +  if (content_type) {
 +      r = s->cio->print("Content-type: %s\r\n", content_type);
 +      if (r < 0) {
 +      ldout(s->cct, 0) << "ERROR: s->cio->print() returned err=" << r << dendl;
 +      }
    }
    r = s->cio->complete_header();
    if (r < 0) {
Simple merge