]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h1: Reset the H1 parser when an outgoing message is processed
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Nov 2018 15:06:57 +0000 (16:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 1 Dec 2018 16:20:36 +0000 (17:20 +0100)
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

index 1ceac128aabacbc199a237fad805d08109c959d9..b9c1b2fcd56bddca2ba8629d476cfe821f5a3841 100644 (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);