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.
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;
}
}
- 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;