gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13260 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r13260 - gnunet/src/dht
Date: Tue, 12 Oct 2010 12:38:41 +0200

Author: nevans
Date: 2010-10-12 12:38:41 +0200 (Tue, 12 Oct 2010)
New Revision: 13260

Modified:
   gnunet/src/dht/gnunet-dht-driver.c
Log:
add dht testing option

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2010-10-12 09:51:26 UTC (rev 13259)
+++ gnunet/src/dht/gnunet-dht-driver.c  2010-10-12 10:38:41 UTC (rev 13260)
@@ -23,8 +23,7 @@
  *        then issuing GETS and PUTS on the DHT.  Coarse results
  *        are reported, fine grained results (if requested) are
  *        logged to a (mysql) database, or to file.
- *
- * FIXME: Do churn!
+ * @author Nathan Evans (who to blame)
  */
 #include "platform.h"
 #ifndef HAVE_MALICIOUS
@@ -428,6 +427,13 @@
 static unsigned int replicate_same;
 
 /**
+ * If GNUNET_YES, issue GET requests at the same peers every time.
+ * Otherwise, choose a new random peer/data combination to search
+ * each time.
+ */
+static unsigned int get_from_same;
+
+/**
  * Number of rounds for testing (PUTS + GETS)
  */
 static unsigned long long total_rounds;
@@ -1546,8 +1552,11 @@
     }
 
   /* Reset the uid (which item to search for) and the daemon (which peer to 
search from) for later get request iterations */
-  test_get->uid = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 
num_puts);
-  test_get->daemon = GNUNET_TESTING_daemon_get(pg, 
GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, num_peers));
+  if (get_from_same == GNUNET_NO)
+    {
+      test_get->uid = GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, 
num_puts);
+      test_get->daemon = GNUNET_TESTING_daemon_get(pg, 
GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, num_peers));
+    }
 
 #if VERBOSE > 1
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%d gets succeeded, %d gets failed!\n", 
gets_completed, gets_failed);
@@ -2807,10 +2816,15 @@
    * Get testing related options.
    */
   if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno(cfg, "DHT_TESTING", 
"REPLICATE_SAME"))
-    {
-      replicate_same = GNUNET_YES;
-    }
+    replicate_same = GNUNET_YES;
 
+  /**
+   * Get testing related options.
+   */
+  if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_yesno(cfg, "DHT_TESTING", 
"GET_FROM_SAME"))
+    get_from_same = GNUNET_YES;
+
+
   if (GNUNET_NO == GNUNET_CONFIGURATION_get_value_time (cfg, "DHT_TESTING",
                                                        
"MALICIOUS_GET_FREQUENCY",
                                                        
&malicious_get_frequency))
@@ -3035,7 +3049,6 @@
     }
 }
 
-
 int
 main (int argc, char *argv[])
 {




reply via email to

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