aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2010-11-29 14:59:14 +0000
committerNathan S. Evans <evans@in.tum.de>2010-11-29 14:59:14 +0000
commit31c05b833f0d6e87c8626a002f5a2060e4222f56 (patch)
tree08bd136f9f6eb9a1d6df7817030a5e83819134f1 /src/dht/gnunet-service-dht.c
parent586bd0361d09b33d03291ad313a513c5c0c6e0f6 (diff)
downloadgnunet-31c05b833f0d6e87c8626a002f5a2060e4222f56.tar.gz
gnunet-31c05b833f0d6e87c8626a002f5a2060e4222f56.zip
tracking down strange routing behavior
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r--src/dht/gnunet-service-dht.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 795363192..e3eed09e9 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -2669,7 +2669,6 @@ handle_dht_put (const struct GNUNET_MessageHeader *msg,
2669#if DEBUG_DHT_ROUTING 2669#if DEBUG_DHT_ROUTING
2670 if ((debug_routes_extended) && (dhtlog_handle != NULL)) 2670 if ((debug_routes_extended) && (dhtlog_handle != NULL))
2671 { 2671 {
2672 /** Log routes that die due to high load! */
2673 dhtlog_handle->insert_route (NULL, msg_ctx->unique_id, DHTLOG_ROUTE, 2672 dhtlog_handle->insert_route (NULL, msg_ctx->unique_id, DHTLOG_ROUTE,
2674 msg_ctx->hop_count, GNUNET_SYSERR, 2673 msg_ctx->hop_count, GNUNET_SYSERR,
2675 &my_identity, &msg_ctx->key, msg_ctx->peer, 2674 &my_identity, &msg_ctx->key, msg_ctx->peer,
@@ -2688,7 +2687,6 @@ handle_dht_put (const struct GNUNET_MessageHeader *msg,
2688#if DEBUG_DHT_ROUTING 2687#if DEBUG_DHT_ROUTING
2689 if ((debug_routes_extended) && (dhtlog_handle != NULL)) 2688 if ((debug_routes_extended) && (dhtlog_handle != NULL))
2690 { 2689 {
2691 /** Log routes that die due to high load! */
2692 dhtlog_handle->insert_route (NULL, msg_ctx->unique_id, DHTLOG_ROUTE, 2690 dhtlog_handle->insert_route (NULL, msg_ctx->unique_id, DHTLOG_ROUTE,
2693 msg_ctx->hop_count, GNUNET_SYSERR, 2691 msg_ctx->hop_count, GNUNET_SYSERR,
2694 &my_identity, &msg_ctx->key, msg_ctx->peer, 2692 &my_identity, &msg_ctx->key, msg_ctx->peer,
@@ -3095,7 +3093,9 @@ select_peer (const GNUNET_HashCode * target,
3095 my_matching_bits = GNUNET_CRYPTO_hash_matching_bits(target, &my_identity.hashPubKey); 3093 my_matching_bits = GNUNET_CRYPTO_hash_matching_bits(target, &my_identity.hashPubKey);
3096 3094
3097 total_distance = 0; 3095 total_distance = 0;
3098 if (strict_kademlia == GNUNET_YES) 3096 /** If we are doing kademlia routing, or converge is binary (saves some cycles) */
3097 if ((strict_kademlia == GNUNET_YES) ||
3098 ((converge_option == DHT_CONVERGE_BINARY) && (hops >= converge_modifier)))
3099 { 3099 {
3100 largest_distance = 0; 3100 largest_distance = 0;
3101 chosen = NULL; 3101 chosen = NULL;
@@ -3223,7 +3223,7 @@ select_peer (const GNUNET_HashCode * target,
3223 3223
3224 if (total_distance == 0) /* No peers to select from! */ 3224 if (total_distance == 0) /* No peers to select from! */
3225 { 3225 {
3226 increment_stats("# select_peer, total_distance == 0"); 3226 increment_stats("# failed to select peer");
3227 return NULL; 3227 return NULL;
3228 } 3228 }
3229 3229
@@ -3660,7 +3660,8 @@ static void
3660demultiplex_message(const struct GNUNET_MessageHeader *msg, 3660demultiplex_message(const struct GNUNET_MessageHeader *msg,
3661 struct DHT_MessageContext *msg_ctx) 3661 struct DHT_MessageContext *msg_ctx)
3662{ 3662{
3663 msg_ctx->closest = am_closest_peer(&msg_ctx->key, NULL); 3663 /* FIXME: Should we use closest excluding those we won't route to (the bloomfilter problem)? */
3664 msg_ctx->closest = am_closest_peer(&msg_ctx->key, msg_ctx->bloom);
3664 switch (ntohs(msg->type)) 3665 switch (ntohs(msg->type))
3665 { 3666 {
3666 case GNUNET_MESSAGE_TYPE_DHT_GET: /* Add to hashmap of requests seen, search for data (always) */ 3667 case GNUNET_MESSAGE_TYPE_DHT_GET: /* Add to hashmap of requests seen, search for data (always) */