Commit
75dd2c18dda29f9893574ef982ddf66de16f0408 made it so if we had a
content-length, and we sent less data than expected, we'd make sure to
close the connection and to not reuse it, otherwise the server would
still expect more data. But it can also happen with no content-length,
with chunked data. There is absolutely no reason we reach that code
while still expecting more data, so just always consider that an error,
no matter if we have content-length or not.
This should be backported up to 2.8.
* announced in Content-Length, we have little choice but to
* close the connection, as the peer will expect more.
*/
- if (((h1s->req.flags & H1_MF_CLEN) && h1s->req.curr_len && !(h1s->flags & H1S_F_BODYLESS_REQ)) ||
- ((h1s->res.flags & H1_MF_CLEN) && h1s->res.curr_len && !(h1s->flags & H1S_F_BODYLESS_RESP)))
+ if ((h1s->req.curr_len && !(h1s->flags & H1S_F_BODYLESS_REQ)) ||
+ (h1s->res.curr_len && !(h1s->flags & H1S_F_BODYLESS_RESP)))
h1c->flags |= H1C_F_ERROR;
if (!(h1c->flags & (H1C_F_EOS|H1C_F_ERR_PENDING|H1C_F_ERROR|H1C_F_ABRT_PENDING|H1C_F_ABRTED)) && /* No error/read0/abort */