gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8653 - GNUnet/src/applications/dv/module


From: gnunet
Subject: [GNUnet-SVN] r8653 - GNUnet/src/applications/dv/module
Date: Thu, 9 Jul 2009 13:28:06 -0600

Author: nevans
Date: 2009-07-09 13:28:05 -0600 (Thu, 09 Jul 2009)
New Revision: 8653

Modified:
   GNUnet/src/applications/dv/module/dv.c
Log:
fixed stat counting bug

Modified: GNUnet/src/applications/dv/module/dv.c
===================================================================
--- GNUnet/src/applications/dv/module/dv.c      2009-07-09 19:24:26 UTC (rev 
8652)
+++ GNUnet/src/applications/dv/module/dv.c      2009-07-09 19:28:05 UTC (rev 
8653)
@@ -37,8 +37,8 @@
 #define DEBUG_DV GNUNET_NO
 #define DEBUG_DV_FORWARD GNUNET_NO
 /* How long to allow a message to be delayed */
-#define DV_DELAY (100 * GNUNET_CRON_MILLISECONDS)
-#define DV_PRIORITY 0
+#define DV_DELAY (500 * GNUNET_CRON_MILLISECONDS)
+#define DV_PRIORITY 1
 
 /**
  * Statistics service.
@@ -114,6 +114,21 @@
 }
 
 /*
+ * Update the statistics about dv routing
+ */
+static int
+update_stats ()
+{
+  unsigned int current_stat;
+  unsigned int delta;
+
+  current_stat = stats->get (stat_dv_total_peers);
+  delta = GNUNET_multi_hash_map_size (ctx->extended_neighbors) - current_stat;
+
+  stats->change (stat_dv_total_peers, delta);
+}
+
+/*
  * Deletes a neighbor from the max and min heaps and
  * from the extended neighbor hash map.  Does not delete
  * from the directly connected neighbor list, because
@@ -133,7 +148,7 @@
   GNUNET_free (neighbor);
 
   if (stats != NULL)
-    stats->change (stat_dv_total_peers, -1);
+    update_stats;
   return GNUNET_OK;
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]