]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[BUG] check: we must not check for error before reading a response
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jan 2010 09:35:58 +0000 (10:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jan 2010 09:48:04 +0000 (10:48 +0100)
commita5aa1c86a55f795dc9d52afe0ba0a2847e4c1e5d
tree8b35303f3a2ef9a2aa34cf518be6be9c82c2ce25
parentfc1daaf49759b7cdfbecbafa2ba0f84e2d97688c
[BUG] check: we must not check for error before reading a response

We can receive data with a notification of socket error. But we
must not check for the error before reading the data, because it
may be an asynchronous error notification that we check too early
while the response we're waiting for is available. If there is an
error, recv() will get it.

This should help with servers that close very fast after the response
and should also slightly lower the CPU usage during very fast checks
on massive amounts of servers since we eliminate one system call.

This should probably be backported to 1.3.
src/checks.c