OPTIM: http: set CF_READ_DONTWAIT on response message

strace shows a lot of EAGAIN on small response messages. This
is caused by the fact that the READ_DONTWAIT flag is not set
on response message, it's only there when we want to flush
pending data.

For small responses, it's a waste of CPU cycles to call recv()
for nothing since most of the time, everything we'll need will
be in the first response. Also, this will offer more opportunities
for using splice() to transfer data.
This commit is contained in:
Willy Tarreau 2013-12-15 15:21:32 +01:00
parent ad38acedaa
commit 3f3997e6c6

View file

@ -5230,6 +5230,7 @@ int http_wait_for_response(struct session *s, struct channel *rep, int an_bit)
}
channel_dont_close(rep);
rep->flags |= CF_READ_DONTWAIT; /* try to get back here ASAP */
return 0;
}