about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard Nyberg <rnyberg@murmeldjur.se>2005-07-03 19:35:14 +0000
committerRichard Nyberg <rnyberg@murmeldjur.se>2005-07-03 19:35:14 +0000
commit2cb31f1244d139e79a70a8b9e29d33152301b6ed (patch)
tree788b7a673c33427dcd2eb703f97c2456f7526c7d
parentf9170e868c3919bec0382610d5e1b3533b457477 (diff)
downloadbtpd-2cb31f1244d139e79a70a8b9e29d33152301b6ed.tar.gz
btpd-2cb31f1244d139e79a70a8b9e29d33152301b6ed.zip
Update btpd.npeers in the right place.
-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;
 }