]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: raw_sock: also consider ENOTCONN in addition to EAGAIN for recv()
authorJoshua M. Clulow <josh@sysmgr.org>
Mon, 3 Mar 2014 21:48:42 +0000 (13:48 -0800)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Mar 2014 06:27:18 +0000 (07:27 +0100)
commit0724903143fc3077a587732fdb4b76a12615a35f
treea67b341cd6fbafd410539f285f898b7dfb080eb9
parent7640e72a319905446456ed4892e25989da72c263
BUG/MINOR: raw_sock: also consider ENOTCONN in addition to EAGAIN for recv()

I was testing haproxy-1.5-dev22 on SmartOS (an illumos-based system)
and ran into a problem.  There's a small window after non-blocking
connect() is called, but before the TCP connection is established,
where recv() may return ENOTCONN.  On Linux, the behaviour here seems
to be always to return EAGAIN.  The fix is relatively trivial, and
appears to make haproxy work reliably on current SmartOS (see patch
below).  It's possible that other UNIX platforms exhibit this
behaviour as well.

Note: the equivalent was already done for send() in commit 0ea0cf6
("BUG: raw_sock: also consider ENOTCONN in addition to EAGAIN").
Both patches should be backported to 1.4.
src/raw_sock.c