From 2cb31f1244d139e79a70a8b9e29d33152301b6ed Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Sun, 3 Jul 2005 19:35:14 +0000 Subject: Update btpd.npeers in the right place. --- btpd/net.c | 7 ++----- 1 file 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; } -- cgit 1.4.1