MEDIUM: connection: set the socket shutdown flags on socket errors

When we get a hard error from a syscall indicating the socket is dead,
it makes sense to set the CO_FL_SOCK_WR_SH and CO_FL_SOCK_RD_SH flags
to indicate that the socket may not be used anymore. It will ease the
error processing in health checks where the state of socket is very
important. We'll also be able to avoid some setsockopt(nolinger) after
an error.

For now, the rest of the code is not impacted because CO_FL_ERROR is
always tested prior to these flags.
This commit is contained in:
Willy Tarreau 2013-12-04 23:44:10 +01:00
parent 7fe45698f5
commit 26f4a04744
4 changed files with 9 additions and 6 deletions