From 66229af8df8dd94f595821d00d08039e09eb23a6 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 28 Nov 2018 16:06:57 +0100 Subject: [PATCH] BUG/MEDIUM: mux-h1: Reset the H1 parser when an outgoing message is processed Because multiple HTTP messages can be stored in an HTX structure, it is important to not forget to reset the H1 parser at the beginning of each one. With the current version, this case only happens on the response, when multiple HTTP-1XX responses are forwarded to the client (for instance 103-Early-Hints). So strickly speaking, it is the same message. But for now, internally, each one is a standalone message. Note that it might change in a future version of the HTX. --- src/mux_h1.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mux_h1.c b/src/mux_h1.c index 1ceac128a..b9c1b2fcd 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1187,6 +1187,8 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun break; case HTX_BLK_REQ_SL: + h1m_init_req(h1m); + h1m->flags |= H1_MF_NO_PHDR; sl = htx_get_blk_ptr(chn_htx, blk); h1s->meth = sl->rq.meth; h1_parse_req_vsn(h1m, sl); @@ -1197,6 +1199,8 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun break; case HTX_BLK_RES_SL: + h1m_init_res(h1m); + h1m->flags |= H1_MF_NO_PHDR; sl = htx_get_blk_ptr(chn_htx, blk); h1s->status = sl->st.status; h1_parse_res_vsn(h1m, sl);