From 7107fef4adaf6d7b139270a6e33f54466fbb9b05 Mon Sep 17 00:00:00 2001 From: Leonardo Basilio Date: Wed, 10 Feb 2016 11:19:39 +0100 Subject: [PATCH] Correctly report TCP connection timeout on windows. On nonblocking TCP connects, we set status = ETIMEOUT on failure. On windows, depending on which header files are included, ETIMEOUT is defined differently, and this leads to incomprehensible error messages - so, always use WSAETIMEDOUT here. Trac #651 Signed-off-by: Leonardo Basilio Acked-by: Arne Schwabe Message-Id: URL: http://article.gmane.org/gmane.network.openvpn.devel/11085 Signed-off-by: Gert Doering (cherry picked from commit 5f5229e41d134b659e502bb2597c711aedaf8096) --- src/openvpn/socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 3e30c750a..6b64a0f71 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -962,7 +962,11 @@ openvpn_connect (socket_descriptor_t sd, { if (--connect_timeout < 0) { +#ifdef WIN32 + status = WSAETIMEDOUT; +#else status = ETIMEDOUT; +#endif break; } openvpn_sleep (1); -- 2.47.2