From: Christopher Faulet Date: Wed, 29 Mar 2023 08:23:21 +0000 (+0200) Subject: MINOR: mux-h1: Report an error to the SE descriptor on truncated message X-Git-Tag: v2.8-dev7~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9bacf642d12f6da195617f54f3c44e501902420;p=thirdparty%2Fhaproxy.git 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 1292661fa6..511570496c 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1916,15 +1916,10 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count 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) {