diff --git a/src/mux_h1.c b/src/mux_h1.c index 7517d92f9..4b071f80b 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1912,9 +1912,16 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count se_fl_set(h1s->sd, SE_FL_EOI); TRACE_STATE("report EOI to SE", H1_EV_RX_DATA, h1c->conn, h1s); } - else if (h1m->state < H1_MSG_DONE && (h1m->state != H1_MSG_RPBEFORE || b_data(&h1c->ibuf))) { - se_fl_set(h1s->sd, SE_FL_ERROR); - TRACE_ERROR("message aborted, set error on SC", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s); + else if (h1m->state < H1_MSG_DONE) { + if (h1m->state > H1_MSG_LAST_LF) { + se_fl_set(h1s->sd, SE_FL_ERROR); + TRACE_ERROR("message aborted, set error on SC", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s); + } + else if (b_data(&h1c->ibuf)) { + htx->flags |= HTX_FL_PARSING_ERROR; + TRACE_ERROR("truncated message, set error on SC", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s); + } + /* Otherwise (no data was never received) don't report any error just EOS */ } if (h1s->flags & H1S_F_TX_BLK) {