about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--btpd/net.c2
-rw-r--r--btpd/peer.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/btpd/net.c b/btpd/net.c
index 4e15ae3..903b4df 100644
--- a/btpd/net.c
+++ b/btpd/net.c
@@ -933,7 +933,6 @@ net_connect2(struct sockaddr *sa, socklen_t salen, int *sd)
 	return errno;
     }
 
-    btpd.npeers++;
     return 0;
 }
 
@@ -983,7 +982,6 @@ net_connection_cb(int sd, short type, void *arg)
 	return;
     }
 
-    btpd.npeers++;
     peer_create_in(nsd);
 
     btpd_log(BTPD_L_CONN, "got connection.\n");
diff --git a/btpd/peer.c b/btpd/peer.c
index 1ab125f..2843b75 100644
--- a/btpd/peer.c
+++ b/btpd/peer.c
@@ -151,6 +151,7 @@ peer_create_common(int sd)
     event_set(&p->in_ev, p->sd, EV_READ, net_read_cb, p);
     event_add(&p->in_ev, NULL);
 
+    btpd.npeers++;
     return p;
 }