about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--btpd/net.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/btpd/net.c b/btpd/net.c
index cc908c6..e1296fa 100644
--- a/btpd/net.c
+++ b/btpd/net.c
@@ -934,6 +934,8 @@ net_connect2(struct sockaddr *sa, socklen_t salen, int *sd)
 	close(*sd);
 	return errno;
     }
+
+    btpd.npeers++;
     return 0;
 }
 
@@ -955,12 +957,7 @@ net_connect(const char *ip, int port, int *sd)
 	return errno;
 
     int error = net_connect2(res->ai_addr, res->ai_addrlen, sd);
-	
     freeaddrinfo(res);
-    
-    if (error == 0)
-	btpd.npeers++;
-
     return error;
 }