From: Christopher Faulet Date: Wed, 10 Feb 2021 08:52:07 +0000 (+0100) Subject: MINOR: mux-h1: Be sure EOM flag is set when processing end of outgoing message X-Git-Tag: v2.4-dev8~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=368936703a0ce121bb3a89dd110542f6c1ba5e5a;p=thirdparty%2Fhaproxy.git MINOR: mux-h1: Be sure EOM flag is set when processing end of outgoing message When a message is sent, an extra check is performed when the parser is switch to MSG_DONE state to be sure the EOM flag is really set. This flag is quite new and replaces the EOM block. Thus, this test is a safeguard waiting for a proper refactoring of the outgoing side. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index d94ae54d74..4262b541e6 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2218,6 +2218,11 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun goto error; /* For now return an error */ done: + if (!(chn_htx->flags & HTX_FL_EOM)) { + TRACE_STATE("No EOM flags in done state", H1_EV_TX_DATA|H1_EV_H1C_ERR|H1_EV_H1S_ERR, h1c->conn, h1s); + goto error; /* For now return an error */ + } + h1m->state = H1_MSG_DONE; if (!(h1m->flags & H1_MF_RESP) && h1s->meth == HTTP_METH_CONNECT) { h1c->flags |= H1C_F_WAIT_INPUT;