BUG/MEDIUM: sock: really fix detection of early connection failures in for 2.3-
authorWilly Tarreau <w@1wt.eu>
Fri, 27 Aug 2021 13:08:47 +0000 (15:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 Aug 2021 13:14:26 +0000 (15:14 +0200)
commit1ac46824d982df87f5b0ca543d5f4df6212875c9
tree1b7c12a2f01316cf3a002da6abcbef2d6b1e7cad
parent65b9cf31a1975eb32e6696059c2bf9f0cfca2dff
BUG/MEDIUM: sock: really fix detection of early connection failures in for 2.3-

Commit 165560f1a in 2.3 ("BUG/MEDIUM: sock: make sure to never miss early
connection failures") was a backport of the same 2.4 commit that aims at
detecting early connection failures. But it doesn't work in 2.3 and older
because fdtab[].state was split between fdtab[].ev and fdtab[].state before
2.4. So the extra condition that checks for the presence of FD_POLL_HUP or
FD_POLL_ERR in fdtab[].state results in checking for a flag that is never
there or for send activity, both not matching there, resulting in the fix
not working, explaining issues #1367, which in fact, is the same as #1251.
The proper test consists in testing fdtab[].ev.

This needs to be backported as far as the commit above. There is no mainline
equivalent since the issue is caused by the incorrect backport to 2.3.

Thanks to Christian Albrecht (@albix) for providing lots of extremely useful
captures!
src/connection.c