]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux: do not call conn_xprt_stop_recv() on buffer shortage
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2020 08:44:39 +0000 (09:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2020 10:21:12 +0000 (11:21 +0100)
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
src/mux_h1.c
src/mux_h2.c

index 27f5edce0c30171d57875705ac2b3363733a8e3e..bfe44017ef9b1f252742b8015acc52c16f3bc06e 100644 (file)
@@ -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;
 }
index dcba3dfb8be03e4cde2791133ffd8722e5fc2609..f175ac9bce9c564111a75784b4d1685c4fee7da7 100644 (file)
@@ -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;
 }
index d726944a32cdc1981652efaa007dd3ef50fb53f3..a73ab0538abe581bf7b0d88a0f2b55dc18e5c607 100644 (file)
@@ -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;
 }