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.4_alpha1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f5229e41d134b659e502bb2597c711aedaf8096;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 --- diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 396fa5427..714a847a9 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -1177,7 +1177,11 @@ openvpn_connect (socket_descriptor_t sd, { if (--connect_timeout < 0) { +#ifdef WIN32 + status = WSAETIMEDOUT; +#else status = ETIMEDOUT; +#endif break; } openvpn_sleep (1);