mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-20 12:46:56 +00:00
MEDIUM: h1: Don't wake the H1 tasklet if we got the whole request.
In h1_rcv_buf(), don't wake the H1 tasklet to attempt to receive more data if we got the whole request. It will lead to a recv and maybe to a subscribe while it may not be needed. If the connection is keep alive, the tasklet will be woken up later by h1_detach(), so that we'll be able to get the next request, or an end of connection.
This commit is contained in:
parent
cc3fec8ac9
commit
dedd30610b
@ -2429,20 +2429,21 @@ static size_t h1_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
||||
{
|
||||
struct h1s *h1s = cs->ctx;
|
||||
struct h1c *h1c = h1s->h1c;
|
||||
struct h1m *h1m = (!conn_is_back(cs->conn) ? &h1s->req : &h1s->res);
|
||||
size_t ret = 0;
|
||||
|
||||
if (!(h1c->flags & H1C_F_IN_ALLOC))
|
||||
ret = h1_process_input(h1c, buf, count);
|
||||
|
||||
if (flags & CO_RFL_BUF_FLUSH) {
|
||||
struct h1m *h1m = (!conn_is_back(cs->conn) ? &h1s->req : &h1s->res);
|
||||
|
||||
if (h1m->state != H1_MSG_TUNNEL || (h1m->state == H1_MSG_DATA && h1m->curr_len))
|
||||
h1s->flags |= H1S_F_BUF_FLUSH;
|
||||
}
|
||||
else if (ret > 0 || (h1s->flags & H1S_F_SPLICED_DATA)) {
|
||||
h1s->flags &= ~H1S_F_SPLICED_DATA;
|
||||
if (!(h1c->wait_event.events & SUB_RETRY_RECV))
|
||||
if (h1m->state != H1_MSG_DONE &&
|
||||
!(h1c->wait_event.events & SUB_RETRY_RECV))
|
||||
tasklet_wakeup(h1c->wait_event.tasklet);
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user