if (!buf || !len)
return;
- uh_chunk_write(cl, buf, len);
+ if (!r->skip_data)
+ uh_chunk_write(cl, buf, len);
+
ustream_consume(s, len);
}
while (ustream_poll(&r->sfd.stream));
- if (!(r->process_done || s->eof) || ustream_pending_data(s, false))
+ if (!(r->process_done || s->eof) || (ustream_pending_data(s, false) && !r->header_cb))
return;
uh_relay_close(r, r->ret);