]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2: pre-initialize h1m->err_pos to -1 on the output path
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 07:24:38 +0000 (09:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 15:38:25 +0000 (17:38 +0200)
We don't want to trigger an error while parsing a response coming from
haproxy (it could be an errorfile for example), so let's set this to
-1.

src/mux_h2.c

index 79be3ce02925110e1ac983f4561f5c0497ef4867..546debb8d004f64d7812d5d41e6edbabfbc4a32d 100644 (file)
@@ -691,6 +691,7 @@ static struct h2s *h2c_stream_new(struct h2c *h2c, int id)
        h2s->st        = H2_SS_IDLE;
        h2s->rxbuf     = BUF_NULL;
        h1m_init_res(&h2s->h1m);
+       h2s->h1m.err_pos = -1; // don't care about errors on the response path
        h2s->by_id.key = h2s->id = id;
        h2c->max_id    = id;
 
@@ -3231,6 +3232,7 @@ static size_t h2s_frt_make_resp_headers(struct h2s *h2s, const struct buffer *bu
        else if (h1m->status >= 100 && h1m->status < 200) {
                /* we'll let the caller check if it has more headers to send */
                h1m_init_res(h1m);
+               h1m->err_pos = -1; // don't care about errors on the response path
                goto end;
        }
        else