]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stream-int: make sure to try to immediately validate the connection
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 15:42:03 +0000 (16:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 18:29:12 +0000 (19:29 +0100)
commitada4c5806baf2c7fc4f19b133bfb72eda0f1cd75
treea7767c741c0df8d9da277ea889de3ecc1293cc6e
parent667fefdc906bd4d4fc373be9125a8f397ae69b2b
MEDIUM: stream-int: make sure to try to immediately validate the connection

In the rare case of immediate connect() (unix sockets, socket pairs, and
occasionally TCP over the loopback), it is counter-productive to subscribe
for sending and then getting immediately back to process_stream() after
having passed through si_cs_process() just to update the connection. We
already know it is established and it doesn't have any handshake anymore
so we just have to complete it and return to process_stream() with the
stream_interface in the SI_ST_RDY state. In this case, process_stream will
simply loop back to the beginning to synchronize the state and turn it to
SI_ST_EST/ASS/CLO/TAR etc.

This will save us from having to needlessly subscribe in the connect()
code, something which in addition cannot work with edge-triggered pollers.
src/backend.c
src/stream.c