http_set_hdr(&hdr[hdr_count++], n, v);
- if (sl.st.status >= 100 && sl.st.status < 200)
- h1m->curr_len = h1m->body_len = 0;
- else if (sl.st.status == 304 || sl.st.status == 204) {
- /* no contents, claim c-len is present and set to zero */
- h1m->flags |= H1_MF_CLEN;
- h1m->curr_len = h1m->body_len = 0;
- }
- else if (isteqi(n, ist("transfer-encoding"))) {
+ if (isteqi(n, ist("transfer-encoding"))) {
h1m->flags &= ~H1_MF_CLEN;
h1m->flags |= H1_MF_CHNK;
}
}
h2s->status = sl.st.status;
+
+ /* certain statuses have no body or an empty one, regardless of
+ * what the headers say.
+ */
+ if (sl.st.status >= 100 && sl.st.status < 200) {
+ h1m->flags &= ~(H1_MF_CLEN | H1_MF_CHNK);
+ h1m->curr_len = h1m->body_len = 0;
+ }
+ else if (sl.st.status == 204 || sl.st.status == 304) {
+ /* no contents, claim c-len is present and set to zero */
+ h1m->flags &= ~H1_MF_CHNK;
+ h1m->flags |= H1_MF_CLEN;
+ h1m->curr_len = h1m->body_len = 0;
+ }
+
chunk_reset(&outbuf);
while (1) {