aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-02-15 11:54:55 +0000
committerNathan S. Evans <evans@in.tum.de>2011-02-15 11:54:55 +0000
commit72aa3a0c2a970ae8303ea4b29bef76371b59f6be (patch)
tree8019ebe89a9c5769b39a12c37a9f244c18712293 /src/dht
parenteb54e71c06366aa5b3b7b7cd5cb2d0b435bb2d63 (diff)
downloadgnunet-72aa3a0c2a970ae8303ea4b29bef76371b59f6be.tar.gz
gnunet-72aa3a0c2a970ae8303ea4b29bef76371b59f6be.zip
change to dht profiling driver to avoid possible find peer issue
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/dht_api.c2
-rw-r--r--src/dht/gnunet-dht-driver.c23
2 files changed, 22 insertions, 3 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index 6194e02cf..ae191660a 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -298,7 +298,7 @@ try_reconnect (void *cls,
298 handle->client = GNUNET_CLIENT_connect ("dht", handle->cfg); 298 handle->client = GNUNET_CLIENT_connect ("dht", handle->cfg);
299 if (handle->client == NULL) 299 if (handle->client == NULL)
300 { 300 {
301 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 301 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
302 "dht reconnect failed(!)\n"); 302 "dht reconnect failed(!)\n");
303 return; 303 return;
304 } 304 }
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c
index 16e3aa93d..dfe073ce5 100644
--- a/src/dht/gnunet-dht-driver.c
+++ b/src/dht/gnunet-dht-driver.c
@@ -449,6 +449,11 @@ static unsigned long long test_data_size = DEFAULT_TEST_DATA_SIZE;
449static unsigned long long max_outstanding_connections; 449static unsigned long long max_outstanding_connections;
450 450
451/** 451/**
452 * Maximum number of concurrent ssh instances to peers.
453 */
454static unsigned long long max_concurrent_ssh;
455
456/**
452 * Maximum number of concurrent PUT requests. 457 * Maximum number of concurrent PUT requests.
453 */ 458 */
454static unsigned long long max_outstanding_puts = DEFAULT_MAX_OUTSTANDING_PUTS; 459static unsigned long long max_outstanding_puts = DEFAULT_MAX_OUTSTANDING_PUTS;
@@ -2100,7 +2105,12 @@ schedule_find_peer_requests (void *cls, const struct GNUNET_SCHEDULER_TaskContex
2100 for (i = 0; i < find_peer_ctx->total; i++) 2105 for (i = 0; i < find_peer_ctx->total; i++)
2101 { 2106 {
2102 test_find_peer = GNUNET_malloc(sizeof(struct TestFindPeer)); 2107 test_find_peer = GNUNET_malloc(sizeof(struct TestFindPeer));
2103 if (find_peer_ctx->previous_peers == 0) /* If we haven't sent any requests yet, choose random peers */ 2108 /* If we haven't sent any requests yet, choose random peers */
2109 /* Also choose random in _half_ of all cases, so we don't
2110 * get stuck choosing topologically restricted peers with
2111 * few connections that will never be able to find any new
2112 * peers! */
2113 if ((find_peer_ctx->previous_peers == 0) || (i % 2 == 0))
2104 { 2114 {
2105 /** 2115 /**
2106 * Attempt to spread find peer requests across even sections of the peer address 2116 * Attempt to spread find peer requests across even sections of the peer address
@@ -2816,6 +2826,14 @@ run (void *cls,
2816 return; 2826 return;
2817 } 2827 }
2818 2828
2829 if (GNUNET_OK !=
2830 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "max_concurrent_ssh",
2831 &max_concurrent_ssh))
2832 {
2833 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "max_concurrent_ssh");
2834 return;
2835 }
2836
2819 /** 2837 /**
2820 * Get DHT specific testing options. 2838 * Get DHT specific testing options.
2821 */ 2839 */
@@ -2998,7 +3016,7 @@ run (void *cls,
2998 { 3016 {
2999 data[count] = '\0'; 3017 data[count] = '\0';
3000 temphost = GNUNET_malloc(sizeof(struct GNUNET_TESTING_Host)); 3018 temphost = GNUNET_malloc(sizeof(struct GNUNET_TESTING_Host));
3001 ret = sscanf(buf, "%a[a-zA-Z0-9]@%a[a-zA-Z0-9.]:%hd", &temphost->username, &temphost->hostname, &temphost->port); 3019 ret = sscanf(buf, "%a[a-zA-Z0-9_]@%a[a-zA-Z0-9.]:%hd", &temphost->username, &temphost->hostname, &temphost->port);
3002 if (3 == ret) 3020 if (3 == ret)
3003 { 3021 {
3004 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Successfully read host %s, port %d and user %s from file\n", temphost->hostname, temphost->port, temphost->username); 3022 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 @@ run (void *cls,
3368 pg = GNUNET_TESTING_daemons_start (cfg, 3386 pg = GNUNET_TESTING_daemons_start (cfg,
3369 peers_left, 3387 peers_left,
3370 max_outstanding_connections, 3388 max_outstanding_connections,
3389 max_concurrent_ssh,
3371 GNUNET_TIME_relative_multiply(seconds_per_peer_start, num_peers), 3390 GNUNET_TIME_relative_multiply(seconds_per_peer_start, num_peers),
3372 &hostkey_callback, NULL, 3391 &hostkey_callback, NULL,
3373 &peers_started_callback, NULL, 3392 &peers_started_callback, NULL,