From: Willy Tarreau Date: Fri, 21 Feb 2020 08:44:39 +0000 (+0100) Subject: BUG/MINOR: mux: do not call conn_xprt_stop_recv() on buffer shortage X-Git-Tag: v2.2-dev3~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d57e34978db7482ebdb0557f2908a033c40394c2;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux: do not call conn_xprt_stop_recv() on buffer shortage In H1/H2/FCGI, the *_get_buf() functions try to disable receipt of data when there's no buffer available. But they do so at the lowest possible level, which is unrelated to the upper transport layers which may still be trying to feed data based on subscription. The correct approach here would theorically be to only disable subscription, though when we get there, the subscription will already have been dropped, so we can safely just remove that call. It's unlikely that this could have had any practical impact, as the upper xprt layer would call this callback which would fail an not resubscribe. Having the lowest layer disabled would just be temporary since when re-enabling reading, a subscribe at the end of data would re-enable it. Backport should not harm but seems useless at this point. --- diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 27f5edce0c..bfe44017ef 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -608,7 +608,6 @@ static inline struct buffer *fcgi_get_buf(struct fcgi_conn *fconn, struct buffer HA_SPIN_LOCK(BUF_WQ_LOCK, &buffer_wq_lock); LIST_ADDQ(&buffer_wq, &fconn->buf_wait.list); HA_SPIN_UNLOCK(BUF_WQ_LOCK, &buffer_wq_lock); - __conn_xprt_stop_recv(fconn->conn); } return buf; } diff --git a/src/mux_h1.c b/src/mux_h1.c index dcba3dfb8b..f175ac9bce 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -422,7 +422,6 @@ static inline struct buffer *h1_get_buf(struct h1c *h1c, struct buffer *bptr) HA_SPIN_LOCK(BUF_WQ_LOCK, &buffer_wq_lock); LIST_ADDQ(&buffer_wq, &h1c->buf_wait.list); HA_SPIN_UNLOCK(BUF_WQ_LOCK, &buffer_wq_lock); - __conn_xprt_stop_recv(h1c->conn); } return buf; } diff --git a/src/mux_h2.c b/src/mux_h2.c index d726944a32..a73ab0538a 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -686,7 +686,6 @@ static inline struct buffer *h2_get_buf(struct h2c *h2c, struct buffer *bptr) HA_SPIN_LOCK(BUF_WQ_LOCK, &buffer_wq_lock); LIST_ADDQ(&buffer_wq, &h2c->buf_wait.list); HA_SPIN_UNLOCK(BUF_WQ_LOCK, &buffer_wq_lock); - __conn_xprt_stop_recv(h2c->conn); } return buf; }