]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Don't process input or ouput if an error occurred
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 4 Jul 2019 19:22:34 +0000 (21:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 5 Jul 2019 12:26:15 +0000 (14:26 +0200)
It is useless to proceed if an error already occurred. Instead, it is better to
wait it will be catched by the stream or the connection, depending on which is
the first one to detect it.

This patch must be backported to 2.0.

src/mux_h1.c

index 89d9b7b6516ce7ac4d6e25da77e89ee25c515c00..8712d2a0f8c0f7d9ff775f99af8d9804de44de7a 100644 (file)
@@ -1390,6 +1390,9 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, size_t count
        }
 
        data = htx->data;
+       if (h1s->flags & errflag)
+               goto end;
+
        do {
                size_t used = htx_used_space(htx);
 
@@ -1507,6 +1510,9 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun
                errflag = H1S_F_REQ_ERROR;
        }
 
+       if (h1s->flags & errflag)
+               goto end;
+
        /* the htx is non-empty thus has at least one block */
        blk = htx_get_head_blk(chn_htx);