From: Christopher Faulet Date: Thu, 16 Sep 2021 06:16:23 +0000 (+0200) Subject: BUG/MAJOR: mux-h1: Don't eval input data if an error was reported X-Git-Tag: v2.5-dev8~188 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab7389dc3cef3bf09ef23a1127d4bc0ca7a8b0a0;p=thirdparty%2Fhaproxy.git BUG/MAJOR: mux-h1: Don't eval input data if an error was reported If an error was already reported on the H1 connection, pending input data must not be (re)evaluated in h1_process(). Otherwise an unexpected internal error will be reported, in addition of the first one. And on some conditions, this may generate an infinite loop because the mux tries to send an internal error but it fails to do so thus it loops to retry. This patch should fix the issue #1356. It must be backported to 2.4. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 729d761369..be9596bf17 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2635,8 +2635,8 @@ static int h1_process(struct h1c * h1c) /* Try to parse now the first block of a request, creating the H1 stream if necessary */ if (b_data(&h1c->ibuf) && /* Input data to be processed */ - (h1c->flags & H1C_F_ST_ALIVE) && !(h1c->flags & H1C_F_ST_READY) && /* ST_IDLE/ST_EMBRYONIC or ST_ATTACH but not ST_READY */ - !(h1c->flags & H1C_F_IN_SALLOC)) { /* No allocation failure on the stream rxbuf */ + (h1c->flags & H1C_F_ST_ALIVE) && !(h1c->flags & H1C_F_ST_READY) && /* ST_IDLE/ST_EMBRYONIC or ST_ATTACH but not ST_READY */ + !(h1c->flags & (H1C_F_IN_SALLOC|H1C_F_ST_ERROR))) { /* No allocation failure on the stream rxbuf and no ERROR on the H1C */ struct buffer *buf; size_t count;