gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -fix DHT loop


From: gnunet
Subject: [gnunet] branch master updated: -fix DHT loop
Date: Mon, 02 Aug 2021 09:24:44 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 703b21859 -fix DHT loop
703b21859 is described below

commit 703b21859b69ba2200974afe713f02b0c5574804
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Aug 2 09:21:12 2021 +0200

    -fix DHT loop
---
 src/dht/gnunet-service-dht_neighbours.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/dht/gnunet-service-dht_neighbours.c 
b/src/dht/gnunet-service-dht_neighbours.c
index 2c30f0b68..ca255310c 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -894,7 +894,7 @@ get_distance (const struct GNUNET_HashCode *target,
               unsigned int bucket)
 {
   uint64_t lsb = 0;
-  
+
   for (unsigned int i = bucket + 1;
        (i < sizeof(struct GNUNET_HashCode) * 8) &&
        (i < bucket + 1 + 64);
@@ -997,14 +997,15 @@ select_peer (const struct GNUNET_HashCode *key,
     chosen = NULL;
     for (bc = 0; bc <= closest_bucket; bc++)
     {
-      pos = k_buckets[bc].head;
       count = 0;
-      while ( (pos != NULL) &&
-              (count < bucket_size) )
+      for (pos = k_buckets[bc].head;
+           (pos != NULL) &&
+           (count < bucket_size);
+           pos = pos->next)
       {
         unsigned int bucket;
         uint64_t dist;
-        
+
         bucket = GNUNET_CRYPTO_hash_matching_bits (key,
                                                    &pos->phash);
         dist = get_distance (key,
@@ -1037,7 +1038,6 @@ select_peer (const struct GNUNET_HashCode *key,
           chosen = NULL;
         }
         count++;
-        pos = pos->next;
       }
     }
     if (NULL == chosen)

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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