]> git.kaiwu.me - haproxy.git/commit
[MEDIUM] connect to servers even when the input has already been closed
authorWilly Tarreau <w@1wt.eu>
Sun, 14 Mar 2010 18:21:34 +0000 (19:21 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 14 Mar 2010 18:21:34 +0000 (19:21 +0100)
commit296897f2c6b01c3702487eecf5f413321b23528b
treea5f3507608e3416d0786ec60056c739407ea3d71
parent1d21e0a28edef4bf116e904d3c25659c4658aaf0
[MEDIUM] connect to servers even when the input has already been closed

The BF_AUTO_CLOSE flag prevented a connection from establishing on
a server if the other side's input channel was already closed. This
is wrong because there may be pending data to be sent.

This was causing an issue with stats, as noticed and reported by
Cyril Bonté. Since the stats are now handled as a server, sometimes
concurrent accesses were causing one of the connections to send the
shutdown(write) before the connection to the stats function was
established, which aborted it early.

This fix causes the BF_AUTO_CLOSE flag to be checked only when the
connection on the outgoing stream interface has reached an established
state. That way we're still able to connect, send the request then
close.
src/session.c