aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-18 10:44:15 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-18 10:44:15 +0000
commitff0c0c5eb34e719b56d969ae15ee9e311c446553 (patch)
tree053bea3ab6e1670ac34613c5a4b632e921834e8a /src/dv
parentae98f60033937c8c94a015cb82dcf1393298a759 (diff)
downloadgnunet-ff0c0c5eb34e719b56d969ae15ee9e311c446553.tar.gz
gnunet-ff0c0c5eb34e719b56d969ae15ee9e311c446553.zip
-count direct neighbors in stats
Diffstat (limited to 'src/dv')
-rw-r--r--src/dv/gnunet-service-dv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index edb06c43d..352a5862d 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -738,6 +738,9 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
738 } 738 }
739 if (DIRECT_NEIGHBOR_COST != distance) 739 if (DIRECT_NEIGHBOR_COST != distance)
740 return; /* is a DV-neighbor */ 740 return; /* is a DV-neighbor */
741 GNUNET_STATISTICS_update (stats,
742 "# peers connected (1-hop)",
743 -1 1, GNUNET_NO);
741 neighbor = GNUNET_malloc (sizeof (struct DirectNeighbor)); 744 neighbor = GNUNET_malloc (sizeof (struct DirectNeighbor));
742 neighbor->peer = *peer; 745 neighbor->peer = *peer;
743 GNUNET_assert (GNUNET_YES == 746 GNUNET_assert (GNUNET_YES ==
@@ -1381,6 +1384,9 @@ handle_core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
1381 /* must have been a DV-neighbor, ignore */ 1384 /* must have been a DV-neighbor, ignore */
1382 return; 1385 return;
1383 } 1386 }
1387 GNUNET_STATISTICS_update (stats,
1388 "# peers connected (1-hop)",
1389 -1 1, GNUNET_NO);
1384 cleanup_neighbor (neighbor); 1390 cleanup_neighbor (neighbor);
1385 GNUNET_CONTAINER_multihashmap_iterate (direct_neighbors, 1391 GNUNET_CONTAINER_multihashmap_iterate (direct_neighbors,
1386 &refresh_routes, 1392 &refresh_routes,