diff --git a/include/haproxy/mux_h1-t.h b/include/haproxy/mux_h1-t.h index e0c29c25e..a886d364c 100644 --- a/include/haproxy/mux_h1-t.h +++ b/include/haproxy/mux_h1-t.h @@ -100,6 +100,9 @@ static forceinline char *h1c_show_flags(char *buf, size_t len, const char *delim #define H1S_F_PARSING_ERROR 0x00000800 /* Set when an error occurred during the message parsing */ #define H1S_F_PROCESSING_ERROR 0x00001000 /* Set when an error occurred during the message xfer */ +#define H1S_F_DEMUX_ERROR (H1S_F_INTERNAL_ERROR|H1S_F_NOT_IMPL_ERROR|H1S_F_PARSING_ERROR) +#define H1S_F_MUX_ERROR (H1S_F_INTERNAL_ERROR|H1S_F_PROCESSING_ERROR) + #define H1S_F_HAVE_SRV_NAME 0x00002000 /* Set during output process if the server name header was added to the request */ #define H1S_F_HAVE_O_CONN 0x00004000 /* Set during output process to know connection mode was processed */ #define H1S_F_HAVE_WS_KEY 0x00008000 /* Set during output process to know WS key was found or generated */ diff --git a/src/mux_h1.c b/src/mux_h1.c index f30ea3742..9c64d8fb7 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2109,7 +2109,7 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res); data = htx->data; - if (h1s->flags & (H1S_F_INTERNAL_ERROR|H1S_F_PARSING_ERROR|H1S_F_NOT_IMPL_ERROR)) + if (h1s->flags & H1S_F_DEMUX_ERROR) goto end; if (h1s->flags & H1S_F_RX_BLK) @@ -2206,10 +2206,10 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count } count -= htx_used_space(htx) - used; - } while (!(h1s->flags & (H1S_F_PARSING_ERROR|H1S_F_NOT_IMPL_ERROR|H1S_F_RX_BLK|H1S_F_RX_CONGESTED))); + } while (!(h1s->flags & (H1S_F_DEMUX_ERROR|H1S_F_RX_BLK|H1S_F_RX_CONGESTED))); - if (h1s->flags & (H1S_F_PARSING_ERROR|H1S_F_NOT_IMPL_ERROR)) { + if (h1s->flags & H1S_F_DEMUX_ERROR) { TRACE_ERROR("parsing or not-implemented error", H1_EV_RX_DATA|H1_EV_H1S_ERR, h1c->conn, h1s); goto err; } @@ -3442,7 +3442,7 @@ static size_t h1_process_mux(struct h1c *h1c, struct buffer *buf, size_t count) if (htx_is_empty(htx)) goto end; - if (h1s->flags & (H1S_F_INTERNAL_ERROR|H1S_F_PROCESSING_ERROR|H1S_F_TX_BLK)) + if (h1s->flags & (H1S_F_MUX_ERROR|H1S_F_TX_BLK)) goto end; if (!h1_get_obuf(h1c)) { @@ -3452,7 +3452,7 @@ static size_t h1_process_mux(struct h1c *h1c, struct buffer *buf, size_t count) h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->res : &h1s->req); while (!(h1c->flags & H1C_F_OUT_FULL) && - !(h1s->flags & (H1S_F_PROCESSING_ERROR|H1S_F_TX_BLK)) && + !(h1s->flags & (H1S_F_MUX_ERROR|H1S_F_TX_BLK)) && !htx_is_empty(htx) && count) { switch (h1m->state) { case H1_MSG_RQBEFORE: