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.
This commit is contained in:
Christopher Faulet 2018-11-28 16:06:57 +01:00 committed by Willy Tarreau
parent 5999b86500
commit 66229af8df

View File

@ -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);