From 5f5229e41d134b659e502bb2597c711aedaf8096 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 --- src/openvpn/socket.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.47.2