]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Be sure EOM flag is set when processing end of outgoing message
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Feb 2021 08:52:07 +0000 (09:52 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Feb 2021 15:25:42 +0000 (16:25 +0100)
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.

src/mux_h1.c

index d94ae54d743e81fb920486e411883258b7102023..4262b541e68c8b8b1e49f17a58405f2b95b7202c 100644 (file)
@@ -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;