From: Leonardo Basilio Date: Wed, 10 Feb 2016 10:19:39 +0000 (+0100) Subject: Correctly report TCP connection timeout on windows. X-Git-Tag: v2.3.11~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7107fef4adaf6d7b139270a6e33f54466fbb9b05;p=thirdparty%2Fopenvpn.git 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) --- 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);