From: Willy Tarreau Date: Fri, 31 Jul 2020 07:15:43 +0000 (+0200) Subject: MINOR: mux-h1: do not even try to receive if the connection is not fully set up X-Git-Tag: v2.3-dev2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2febb846a46a222f90d6cef47494677460d564df;p=thirdparty%2Fhaproxy.git MINOR: mux-h1: do not even try to receive if the connection is not fully set up If the connection is still waiting for L4/L6, there's no point even trying to receive as it will fail, so better return zero in h1_recv_allowed(). --- diff --git a/src/mux_h1.c b/src/mux_h1.c index b3fa8f505f..ea52119a9f 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -363,8 +363,8 @@ static inline int h1_recv_allowed(const struct h1c *h1c) return 0; } - if (h1c->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_RD_SH)) { - TRACE_DEVEL("recv not allowed because of (error|read0) on connection", H1_EV_H1C_RECV|H1_EV_H1C_BLK, h1c->conn); + if (h1c->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_RD_SH|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN)) { + TRACE_DEVEL("recv not allowed because of (error|read0|waitl4|waitl6) on connection", H1_EV_H1C_RECV|H1_EV_H1C_BLK, h1c->conn); return 0; }