From afd342ec0c2db5f4f60d29dfec87249c7503a1f5 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 1 Nov 2015 21:07:56 +0100 Subject: [PATCH] Update "now" after connect() when making outgoing connections. It could be that address resolution takes a long time, don't let that count against a connection. This is especially important when using a nameserver from the VPN. --- src/net_socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net_socket.c b/src/net_socket.c index cb27106..c167c2f 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -457,8 +457,11 @@ begin: freeaddrinfo(proxyai); } + now = time(NULL); + if(result == -1) { if(sockinprogress(sockerrno)) { + c->last_ping_time = now; c->status.connecting = true; return; } -- 2.25.1