MINOR: mux-h1: Report an error to the SE descriptor on truncated message
On truncated message, a parsing error is still reported. But an error on the
SE descriptor is also reported. This will avoid any bugs in future. We are
know sure the SC is able to detect the error, independently on the HTTP
analyzers.
diff --git a/src/mux_h1.c b/src/mux_h1.c
index 1292661..5115704 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -1916,15 +1916,10 @@
TRACE_STATE("report EOI to SE", H1_EV_RX_DATA, 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)) {
+ if (h1m->state <= H1_MSG_LAST_LF && 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 */
+ 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);
}
if (h1s->flags & H1S_F_TX_BLK) {