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!
if (!(conn->flags & CO_FL_WAIT_L4_CONN))
return 1; /* strange we were called while ready */
- if (!fd_send_ready(fd) && !(fdtab[fd].state & (FD_POLL_ERR|FD_POLL_HUP)))
+ if (!fd_send_ready(fd) && !(fdtab[fd].ev & (FD_POLL_ERR|FD_POLL_HUP)))
return 0;
/* Here we have 2 cases :