X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fip.c;h=08d32f21b382937f8f4974533e67bc9dc896cf3f;hb=2cee425af0f8c425a410ff12a51f05a175a0c80b;hp=09b4c439e9b2b7f8880df0d3660f4b2f3e637f00;hpb=5903c6ff59527362e869fedb565c56935ce8dd68;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/ip.c b/src/src/ip.c index 09b4c439e..08d32f21b 100644 --- a/src/src/ip.c +++ b/src/src/ip.c @@ -235,14 +235,15 @@ connect in FASTOPEN mode but with zero data. if (fastopen) { - if ( (rc = sendto(sock, NULL, 0, MSG_FASTOPEN, s_ptr, s_len)) < 0 - && errno == EOPNOTSUPP - ) - { - DEBUG(D_transport) - debug_printf("Tried TCP Fast Open but apparently not enabled by sysctl\n"); - rc = connect(sock, s_ptr, s_len); - } + if ((rc = sendto(sock, NULL, 0, MSG_FASTOPEN | MSG_DONTWAIT, s_ptr, s_len)) < 0) + if (errno == EINPROGRESS) /* the expected case */ + rc = 0; + else if(errno == EOPNOTSUPP) + { + DEBUG(D_transport) + debug_printf("Tried TCP Fast Open but apparently not enabled by sysctl\n"); + rc = connect(sock, s_ptr, s_len); + } } else #endif