gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r14404 - gnunet/src/dht
Date: Tue, 15 Feb 2011 12:54:55 +0100

Author: nevans
Date: 2011-02-15 12:54:55 +0100 (Tue, 15 Feb 2011)
New Revision: 14404

Modified:
   gnunet/src/dht/dht_api.c
   gnunet/src/dht/gnunet-dht-driver.c
Log:
change to dht profiling driver to avoid possible find peer issue

Modified: gnunet/src/dht/dht_api.c
===================================================================
--- gnunet/src/dht/dht_api.c    2011-02-15 02:08:00 UTC (rev 14403)
+++ gnunet/src/dht/dht_api.c    2011-02-15 11:54:55 UTC (rev 14404)
@@ -298,7 +298,7 @@
   handle->client = GNUNET_CLIENT_connect ("dht", handle->cfg);
   if (handle->client == NULL)
     {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "dht reconnect failed(!)\n");
       return;
     }

Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c  2011-02-15 02:08:00 UTC (rev 14403)
+++ gnunet/src/dht/gnunet-dht-driver.c  2011-02-15 11:54:55 UTC (rev 14404)
@@ -449,6 +449,11 @@
 static unsigned long long max_outstanding_connections;
 
 /**
+ * Maximum number of concurrent ssh instances to peers.
+ */
+static unsigned long long max_concurrent_ssh;
+
+/**
  * Maximum number of concurrent PUT requests.
  */
 static unsigned long long max_outstanding_puts = DEFAULT_MAX_OUTSTANDING_PUTS;
@@ -2100,7 +2105,12 @@
   for (i = 0; i < find_peer_ctx->total; i++)
     {
       test_find_peer = GNUNET_malloc(sizeof(struct TestFindPeer));
-      if (find_peer_ctx->previous_peers == 0) /* If we haven't sent any 
requests yet, choose random peers */
+      /* If we haven't sent any requests yet, choose random peers */
+      /* Also choose random in _half_ of all cases, so we don't
+       * get stuck choosing topologically restricted peers with
+       * few connections that will never be able to find any new
+       * peers! */
+      if ((find_peer_ctx->previous_peers == 0) || (i % 2 == 0))
         {
           /**
            * Attempt to spread find peer requests across even sections of the 
peer address
@@ -2816,6 +2826,14 @@
       return;
     }
 
+  if (GNUNET_OK !=
+        GNUNET_CONFIGURATION_get_value_number (cfg, "testing", 
"max_concurrent_ssh",
+                                               &max_concurrent_ssh))
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", 
"testing", "max_concurrent_ssh");
+      return;
+    }
+
   /**
    * Get DHT specific testing options.
    */
@@ -2998,7 +3016,7 @@
           {
             data[count] = '\0';
             temphost = GNUNET_malloc(sizeof(struct GNUNET_TESTING_Host));
-            ret = sscanf(buf, "address@hidden:%hd", &temphost->username, 
&temphost->hostname, &temphost->port);
+            ret = sscanf(buf, "address@hidden:%hd", &temphost->username, 
&temphost->hostname, &temphost->port);
             if (3 == ret)
               {
                 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Successfully read host 
%s, port %d and user %s from file\n", temphost->hostname, temphost->port, 
temphost->username);
@@ -3368,6 +3386,7 @@
   pg = GNUNET_TESTING_daemons_start (cfg,
                                      peers_left,
                                      max_outstanding_connections,
+                                     max_concurrent_ssh,
                                      
GNUNET_TIME_relative_multiply(seconds_per_peer_start, num_peers),
                                      &hostkey_callback, NULL,
                                      &peers_started_callback, NULL,




reply via email to

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