summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Hund <heiko.hund@sophos.com>2012-07-17 18:19:53 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2012-07-19 21:20:22 +0200
commit9081e0ad4c496a0334a21fc4e8e4f1f73a470b5a (patch)
treec5d1746942ebbbcf04258fa287eff9746c3975eb
parentcf93f0e0a65d66ed57f24efb7fbd96dc455b3732 (diff)
downloadopenvpn-9081e0ad4c496a0334a21fc4e8e4f1f73a470b5a.tar.gz
openvpn-9081e0ad4c496a0334a21fc4e8e4f1f73a470b5a.tar.xz
openvpn-9081e0ad4c496a0334a21fc4e8e4f1f73a470b5a.zip
make non-blocking connect work on Windows
Instead of EINPROGRESS WinSock2 returns WSAEWOULDBLOCK if a non-blocking connect(2) cannot be completed immediately. Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: 1342541993-32462-1-git-send-email-heiko.hund@sophos.com URL: http://article.gmane.org/gmane.network.openvpn.devel/6875 Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--src/openvpn/socket.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
index 54ebce7..02e2768 100644
--- a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c
@@ -1165,7 +1165,13 @@ openvpn_connect (socket_descriptor_t sd,
status = connect (sd, &remote->addr.sa, af_addr_size(remote->addr.sa.sa_family));
if (status)
status = openvpn_errno_socket ();
- if (status == EINPROGRESS)
+ if (
+#ifdef WIN32
+ status == WSAEWOULDBLOCK
+#else
+ status == EINPROGRESS
+#endif
+ )
{
while (true)
{