]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tcp: check that no error is pending during a connect probe
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Dec 2013 15:11:04 +0000 (16:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Dec 2013 22:50:10 +0000 (23:50 +0100)
commitf12a20ebce8973537c42c600324cce7c47bd5359
tree8fe52228483aa7af26c1dc1c353c28f66992fe84
parent4f48990c1a8ae7944ef1b43081ece6cc4de7d22e
BUG/MINOR: tcp: check that no error is pending during a connect probe

The tcp_connect_probe() function may be called upon I/O activity when
no recv/send callbacks were called (eg: recv not possible, nothing to
send). It only relies on connect() to observe the connection establishment
progress but that does not work when some network errors are pending on
the socket (eg: a delayed connection refused).

For this reason we need to run a getsockopt() in the case where the
poller reports FD_POLL_ERR on the socket. We use this opportunity to
update errno so that the conn->data->wake() function has all relevant
info when it sees CO_FL_ERROR.

At the moment no code is impacted by this bug because recv polling is
always enabled during a connect, so recvfrom() always sees the error
first. But this may change with the health check cleanup.

No backport is needed.
src/proto_tcp.c