summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSupriti Singh <supritisingh08@gmail.com>2014-08-28 07:30:07 +0000
committerSupriti Singh <supritisingh08@gmail.com>2014-08-28 07:30:07 +0000
commitd71aa438769f995b64b4a3d75ac54d0e63f509e2 (patch)
tree2d17d8f2e507fd6d8cf82ef222946c8b3545fec1 /src
parent8e6368dda38346e24844828bac51c4f227983a51 (diff)
Exponential backoff for find finger trail task
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index a658141c3..91e96d8a8 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -963,6 +963,10 @@ static unsigned int total_fingers_found;
static unsigned int successor_times;
/**
+ * Number of rounds for which we should search for finger.
+ */
+static unsigned int fingers_round_count;
+/**
* Called when core is ready to send a message we asked for
* out to the destination.
*
@@ -3507,6 +3511,13 @@ finger_table_add (struct GNUNET_PeerIdentity finger_identity,
{
// find_finger_trail_task_next_send_time =
// GNUNET_TIME_STD_BACKOFF(find_finger_trail_task_next_send_time);
+ if (0 == fingers_round_count)
+ {
+ find_finger_trail_task_next_send_time =
+ GNUNET_TIME_STD_BACKOFF(find_finger_trail_task_next_send_time);
+ }
+ else
+ fingers_round_count--;
current_search_finger_index = 0;
GNUNET_STATISTICS_update (GDS_stats,
gettext_noop
@@ -6081,6 +6092,7 @@ GDS_NEIGHBOURS_init (void)
friend_peermap = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO);
finger_table_init ();
successor_times = 10;
+ fingers_round_count = 5;
find_finger_trail_task_next_send_time.rel_value_us =
DHT_FIND_FINGER_TRAIL_INTERVAL.rel_value_us +
GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,