diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-13 10:34:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-13 10:34:15 +0000 |
commit | a7d5d8337347ccfe4165dcdf9647ea0048756a9a (patch) | |
tree | 7bdb4ed0881893659e15387f05af3ab5af1aba00 | |
parent | 5e982700c48152c0a259d2d98a576b319fb68b8f (diff) |
stuff
-rw-r--r-- | src/dht/gnunet-service-dht.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index ae6041452f..0dc9860a0f 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -26,6 +26,7 @@ * * TODO: * - decide which 'benchmark'/test functions to keep + * - integrate properly with 'block' library (instead of manual bloomfiltering) */ #include "platform.h" @@ -3029,23 +3030,18 @@ get_forward_count (unsigned int hop_count, size_t target_replication) return 0; } - /* FIXME: the smaller we think the network is the more lenient we should be for - * routing right? The estimation below only works if we think we have reasonably - * full routing tables, which for our RR topologies may not be the case! - */ if (hop_count > log_of_network_size_estimate * 2.0) { + if (GNUNET_YES == paper_forwarding) + { + /* Once we have reached our ideal number of hops, don't stop forwarding! */ + return 1; + } #if DEBUG_DHT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hop count too high (est %f, lowest %d), NOT Forwarding request\n", log_of_network_size_estimate * 2.0, lowest_bucket); #endif - /* FIXME: does this work as intended, isn't the decision to forward or not made based on closeness as well? */ - if (GNUNET_YES == paper_forwarding) /* Once we have reached our ideal number of hops, don't stop forwarding! */ - { - return 1; - } - return 0; } @@ -3091,18 +3087,18 @@ get_forward_count (unsigned int hop_count, size_t target_replication) return forward_count; } -/* + +/** * Check whether my identity is closer than any known peers. * If a non-null bloomfilter is given, check if this is the closest * peer that hasn't already been routed to. * * @param target hash code to check closeness to * @param bloom bloomfilter, exclude these entries from the decision - * - * Return GNUNET_YES if node location is closest, GNUNET_NO - * otherwise. + * @return GNUNET_YES if node location is closest, + * GNUNET_NO otherwise. */ -int +static int am_closest_peer (const GNUNET_HashCode * target, struct GNUNET_CONTAINER_BloomFilter *bloom) { @@ -3605,7 +3601,6 @@ route_message (const struct GNUNET_MessageHeader *msg, } - /** * Main function that handles whether or not to route a message to other * peers. |