From d57e34978db7482ebdb0557f2908a033c40394c2 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 21 Feb 2020 09:44:39 +0100 Subject: [PATCH] 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. --- src/mux_fcgi.c | 1 - src/mux_h1.c | 1 - src/mux_h2.c | 1 - 3 files changed, 3 deletions(-) diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 27f5edce0..bfe44017e 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 dcba3dfb8..f175ac9bc 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 d726944a3..a73ab0538 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; }