mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
MINOR: h2: Make sure to return 1 in h2_recv() when needed.
In h2_recv(), return 1 if we have data available, or if h2_recv_allowed() failed, to be sure h2_process() is called. Also don't subscribe if our buffer is full.
This commit is contained in:
parent
85b73e9427
commit
81a15af6bc
@ -2236,10 +2236,10 @@ static int h2_recv(struct h2c *h2c)
|
|||||||
size_t ret;
|
size_t ret;
|
||||||
|
|
||||||
if (h2c->wait_event.wait_reason & SUB_CAN_RECV)
|
if (h2c->wait_event.wait_reason & SUB_CAN_RECV)
|
||||||
return 0;
|
return (b_data(&h2c->dbuf));
|
||||||
|
|
||||||
if (!h2_recv_allowed(h2c))
|
if (!h2_recv_allowed(h2c))
|
||||||
return 0;
|
return 1;
|
||||||
|
|
||||||
buf = h2_get_buf(h2c, &h2c->dbuf);
|
buf = h2_get_buf(h2c, &h2c->dbuf);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
@ -2255,10 +2255,11 @@ static int h2_recv(struct h2c *h2c)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
} while (ret > 0);
|
} while (ret > 0);
|
||||||
|
|
||||||
if (h2_recv_allowed(h2c)) {
|
if (h2_recv_allowed(h2c) && (b_data(buf) < buf->size)) {
|
||||||
conn_xprt_want_recv(conn);
|
conn_xprt_want_recv(conn);
|
||||||
conn->xprt->subscribe(conn, SUB_CAN_RECV, &h2c->wait_event);
|
conn->xprt->subscribe(conn, SUB_CAN_RECV, &h2c->wait_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!b_data(buf)) {
|
if (!b_data(buf)) {
|
||||||
h2_release_buf(h2c, &h2c->dbuf);
|
h2_release_buf(h2c, &h2c->dbuf);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user