]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: checks: don't consider errno and use conn->err_code
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Dec 2013 21:48:23 +0000 (22:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Dec 2013 21:54:39 +0000 (22:54 +0100)
commitea292ae64946ecd75ac0aea4f0d2802ca14d4695
tree8fd248617ab1003a8163907b9b95120f5246b012
parent02b0f58c43db8bf55370d0cd5049546efc451365
BUG/MINOR: checks: don't consider errno and use conn->err_code

The last fix on checks (02b0f58: BUG/MEDIUM: checks: fix a long-standing
issue with reporting connection errors) tried to isolate error codes
retrieved from the socket in order to report appropriate messages. The
only thing is that we must not pre-initialize err to errno since we're
not in I/O context anymore and errno will be the one of the last syscall
(whatever it was). However we can complete the message with more info
from the transport layer (eg: SSL can inform us we were in a handshake).

Also add a catch-all case for CO_FL_ERROR when the connection was
established. No check currently seem to leave this case open, but better
catch it because it's hard to find all possible cases.

Error handling in checks is complex because some stuff must be done in
the central task (mandatory at least for timeouts) and other stuff is
done closer to the data.

Since checks have their own buffers now, we could move everything to
the main task and only keep the low-level I/O for sending/retrieving
data to/from this buffer. It would also avoid sending logs from the
I/O context!
src/checks.c