]> 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>
Thu, 28 Jan 2010 22:16:37 +0000 (23:16 +0100)
commit4623b0e5c45b5e3ee9268ce089f50e86639e8f00
treec3e2acc9cd29ce7f608d2e4c84065e960412fe00
parent014c4bcf1949ecd07a1be373c082ca48867b360f
[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.

(cherry picked from commit a5aa1c86a55f795dc9d52afe0ba0a2847e4c1e5d)
src/checks.c