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) {