diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-02 12:51:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-02 12:51:26 +0000 |
commit | 8c7b3b9d1306ea3c78a577a42d7ebbcecfbeb9b3 (patch) | |
tree | 86c15d8ed8d7f0e5de1038d35c871e7ed1ef3a5a /src/dht/gnunet-service-dht_neighbours.c | |
parent | c9c4ef49195c329851ea68471ccddee6bdff82b4 (diff) | |
download | gnunet-8c7b3b9d1306ea3c78a577a42d7ebbcecfbeb9b3.tar.gz gnunet-8c7b3b9d1306ea3c78a577a42d7ebbcecfbeb9b3.zip |
adding DHT option to disable calls to try connect
Diffstat (limited to 'src/dht/gnunet-service-dht_neighbours.c')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index fdbb29371..7401eb8ac 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -384,6 +384,11 @@ static unsigned int closest_bucket; | |||
384 | static unsigned int newly_found_peers; | 384 | static unsigned int newly_found_peers; |
385 | 385 | ||
386 | /** | 386 | /** |
387 | * Option for testing that disables the 'connect' function of the DHT. | ||
388 | */ | ||
389 | static int disable_try_connect; | ||
390 | |||
391 | /** | ||
387 | * The buckets. Array of size MAX_BUCKET_SIZE. Offset 0 means 0 bits matching. | 392 | * The buckets. Array of size MAX_BUCKET_SIZE. Offset 0 means 0 bits matching. |
388 | */ | 393 | */ |
389 | static struct PeerBucket k_buckets[MAX_BUCKETS]; | 394 | static struct PeerBucket k_buckets[MAX_BUCKETS]; |
@@ -1941,7 +1946,9 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1941 | if (NULL != GDS_transport_handle) | 1946 | if (NULL != GDS_transport_handle) |
1942 | { | 1947 | { |
1943 | GNUNET_TRANSPORT_offer_hello (GDS_transport_handle, h, NULL, NULL); | 1948 | GNUNET_TRANSPORT_offer_hello (GDS_transport_handle, h, NULL, NULL); |
1944 | GNUNET_TRANSPORT_try_connect (GDS_transport_handle, &pid); | 1949 | if (GNUNET_YES != |
1950 | disable_try_connect) | ||
1951 | GNUNET_TRANSPORT_try_connect (GDS_transport_handle, &pid); | ||
1945 | } | 1952 | } |
1946 | } | 1953 | } |
1947 | } | 1954 | } |
@@ -1998,6 +2005,8 @@ GDS_NEIGHBOURS_init () | |||
1998 | }; | 2005 | }; |
1999 | unsigned long long temp_config_num; | 2006 | unsigned long long temp_config_num; |
2000 | 2007 | ||
2008 | disable_try_connect | ||
2009 | = GNUNET_CONFIGURATION_get_value_yesno (GDS_cfg, "DHT", "DISABLE_TRY_CONNECT"); | ||
2001 | if (GNUNET_OK == | 2010 | if (GNUNET_OK == |
2002 | GNUNET_CONFIGURATION_get_value_number (GDS_cfg, "DHT", "bucket_size", | 2011 | GNUNET_CONFIGURATION_get_value_number (GDS_cfg, "DHT", "bucket_size", |
2003 | &temp_config_num)) | 2012 | &temp_config_num)) |