OPTIM: session: set the READ_DONTWAIT flag when connecting
authorWilly Tarreau <w@1wt.eu>
Tue, 31 Dec 2013 21:33:13 +0000 (22:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Dec 2013 21:39:26 +0000 (22:39 +0100)
commitd81ca040514e509dd218fa704f254c9cbc11c39c
treeeaf4e6de960d59748ab0a497df0dff8aeb142d70
parentd7ad9f5b0dbc04574781d5a98840180e0c9c4f68
OPTIM: session: set the READ_DONTWAIT flag when connecting

As soon as we connect to the server, we want to limit the number of
recvfrom() on the response path because most of the time a single
call will retrieve enough information.

At the moment this is only done in the HTTP response parser, after
some reads have already failed, which is too late. We need to do
that at the earliest possible instant. It was already done for the
request side by frontend_accept() for the first request, and by
http_reset_txn() for the next requests.

Thanks to this change, there are no more failed recvfrom() calls in
keep-alive mode.
src/session.c