aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-25 13:28:36 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-25 13:28:36 +0000
commit0bc4bfeedf3972e880a059fab5d0b107205b890c (patch)
treea41fd489d0fb4a8a5a7bd0588ad77edbf08bd35a /src/dht
parent250289d4a2b1a4d5dc11b8502241a16bddeb18e0 (diff)
downloadgnunet-0bc4bfeedf3972e880a059fab5d0b107205b890c.tar.gz
gnunet-0bc4bfeedf3972e880a059fab5d0b107205b890c.zip
ob1
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 9362d28c5..02124b488 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -1022,7 +1022,7 @@ select_peer (const GNUNET_HashCode *key,
1022 /* greedy selection (closest peer that is not in bloomfilter) */ 1022 /* greedy selection (closest peer that is not in bloomfilter) */
1023 smallest_distance = UINT_MAX; 1023 smallest_distance = UINT_MAX;
1024 chosen = NULL; 1024 chosen = NULL;
1025 for (bc = 0; bc < closest_bucket; bc++) 1025 for (bc = 0; bc <= closest_bucket; bc++)
1026 { 1026 {
1027 pos = k_buckets[bc].head; 1027 pos = k_buckets[bc].head;
1028 count = 0; 1028 count = 0;
@@ -1065,7 +1065,7 @@ select_peer (const GNUNET_HashCode *key,
1065 /* select "random" peer */ 1065 /* select "random" peer */
1066 /* count number of peers that are available and not filtered */ 1066 /* count number of peers that are available and not filtered */
1067 count = 0; 1067 count = 0;
1068 for (bc = 0; bc < closest_bucket; bc++) 1068 for (bc = 0; bc <= closest_bucket; bc++)
1069 { 1069 {
1070 pos = k_buckets[bc].head; 1070 pos = k_buckets[bc].head;
1071 while ((pos != NULL) && (count < bucket_size)) 1071 while ((pos != NULL) && (count < bucket_size))
@@ -1100,7 +1100,7 @@ select_peer (const GNUNET_HashCode *key,
1100 /* Now actually choose a peer */ 1100 /* Now actually choose a peer */
1101 selected = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, count); 1101 selected = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, count);
1102 count = 0; 1102 count = 0;
1103 for (bc = 0; bc < closest_bucket; bc++) 1103 for (bc = 0; bc <= closest_bucket; bc++)
1104 { 1104 {
1105 pos = k_buckets[bc].head; 1105 pos = k_buckets[bc].head;
1106 while ((pos != NULL) && (count < bucket_size)) 1106 while ((pos != NULL) && (count < bucket_size))