Hi,

On Sun, Feb 07, 2016 at 06:21:49PM -0200, Leonardo wrote:
> So it seems like socket.c is getting its value from winsock.h. Here's
> a better patch:
> 
> Signed-off-by: Leonardo Basilio <leobasi...@gmail.com>
> ---
>  src/openvpn/socket.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c
> index 396fa54..37fa129 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);

Indeed, this patch works - built a windows binary, tested, get a proper
log message when connecting to a server that is unreachable:

  TCP: connect to ... failed: Connection timed out (WSAETIMEOUT)

So, I'd be happy to merge this.  Alas :-) - it does not apply automatically,
because spaces are all mangled (tabs got replaced by spaces).  Mail clients 
tend to do this, so I'll have to do this manually (not hard here).  For your 
next patch, please use

  git send-email --to=openvpn-devel@lists.sourceforge.net

(test with --to=yourown@address) - it will usually get everything done
perfectly.  If you use an Exchange server as outgoing MTA, things get
more complicated because exchange always breaks stuff - in that case,
git-send-email can be configured to use authenticated SMTP to an outside
server that is well-behaved (like, gmail).

gert

-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             g...@greenie.muc.de
fax: +49-89-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: signature.asc
Description: PGP signature

Reply via email to