]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Make sure to return 1 in h1_recv() when needed
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Dec 2018 15:06:28 +0000 (16:06 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Dec 2018 15:43:30 +0000 (16:43 +0100)
In h1_recv(), return 1 if we have data available, or if h1_recv_allowed()
failed, to be sure h1_process() is called. Also don't subscribe if our buffer
is full.

src/mux_h1.c

index 494c56328b07f7d74006e7f19f5e4bfbe9aeb8a2..533187691cd4e964897b554c395620ab12e47ca7 100644 (file)
@@ -1467,7 +1467,7 @@ static int h1_recv(struct h1c *h1c)
        int rcvd = 0;
 
        if (h1c->wait_event.wait_reason & SUB_CAN_RECV)
-               return 0;
+               return (b_data(&h1c->ibuf));
 
        if (!h1_recv_allowed(h1c)) {
                rcvd = 1;
@@ -1498,7 +1498,7 @@ static int h1_recv(struct h1c *h1c)
                }
        }
 
-       if (h1_recv_allowed(h1c))
+       if (h1_recv_allowed(h1c) && (b_data(&h1c->ibuf) < b_size(&h1c->ibuf)))
                conn->xprt->subscribe(conn, SUB_CAN_RECV, &h1c->wait_event);
        else
                rcvd = 1;