diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-27 14:46:14 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-27 14:46:14 +0000 |
commit | d626a04d7f4b13997a1c72939a7edb5d5cdb8ea6 (patch) | |
tree | 9f43e45a44bb11de6c28c24450a59f44ddc97569 /src/dht | |
parent | f6295616e7a91079e9182ee21f895378733c0522 (diff) | |
download | gnunet-d626a04d7f4b13997a1c72939a7edb5d5cdb8ea6.tar.gz gnunet-d626a04d7f4b13997a1c72939a7edb5d5cdb8ea6.zip |
fix
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht_api.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 88ed4ed9d..2a14b216f 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -425,15 +425,15 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
425 | struct GNUNET_DHT_RouteHandle *rh = value; | 425 | struct GNUNET_DHT_RouteHandle *rh = value; |
426 | const struct GNUNET_MessageHeader *enc_msg; | 426 | const struct GNUNET_MessageHeader *enc_msg; |
427 | size_t enc_size; | 427 | size_t enc_size; |
428 | uint64_t uid; | ||
429 | const struct GNUNET_PeerIdentity **outgoing_path; | 428 | const struct GNUNET_PeerIdentity **outgoing_path; |
430 | const struct GNUNET_PeerIdentity *pos; | 429 | const struct GNUNET_PeerIdentity *pos; |
431 | uint32_t outgoing_path_length; | 430 | uint32_t outgoing_path_length; |
432 | unsigned int i; | 431 | unsigned int i; |
433 | char *path_offset; | 432 | char *path_offset; |
433 | #if HAVE_UID_FOR_TESTING | ||
434 | uint64_t uid; | ||
434 | 435 | ||
435 | uid = GNUNET_ntohll (dht_msg->unique_id); | 436 | uid = GNUNET_ntohll (dht_msg->unique_id); |
436 | #if HAVE_UID_FOR_TESTING | ||
437 | if (uid != rh->uid) | 437 | if (uid != rh->uid) |
438 | { | 438 | { |
439 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 439 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 8cbf918d2..96a43c23f 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -923,13 +923,11 @@ am_closest_peer (const GNUNET_HashCode *key, | |||
923 | int bucket_num; | 923 | int bucket_num; |
924 | int count; | 924 | int count; |
925 | struct PeerInfo *pos; | 925 | struct PeerInfo *pos; |
926 | unsigned int my_distance; | ||
927 | 926 | ||
928 | if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (GNUNET_HashCode))) | 927 | if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (GNUNET_HashCode))) |
929 | return GNUNET_YES; | 928 | return GNUNET_YES; |
930 | bucket_num = find_bucket (key); | 929 | bucket_num = find_bucket (key); |
931 | bits = GNUNET_CRYPTO_hash_matching_bits (&my_identity.hashPubKey, key); | 930 | bits = GNUNET_CRYPTO_hash_matching_bits (&my_identity.hashPubKey, key); |
932 | my_distance = get_distance (&my_identity.hashPubKey, key); | ||
933 | pos = k_buckets[bucket_num].head; | 931 | pos = k_buckets[bucket_num].head; |
934 | count = 0; | 932 | count = 0; |
935 | while ((pos != NULL) && (count < bucket_size)) | 933 | while ((pos != NULL) && (count < bucket_size)) |