diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-13 12:01:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-13 12:01:03 +0000 |
commit | f1ea48fe60c83c43fcaae99b50aa9f6b651f9897 (patch) | |
tree | 62d1be5a5e17fa858b28f0777851db3e57572804 /src/dht/gnunet-service-dht.c | |
parent | 40f1e01afae5598365adc9bf9542227166bddfd0 (diff) | |
download | gnunet-f1ea48fe60c83c43fcaae99b50aa9f6b651f9897.tar.gz gnunet-f1ea48fe60c83c43fcaae99b50aa9f6b651f9897.zip |
dce
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 8d85138cf..117ea860e 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -80,9 +80,10 @@ | |||
80 | */ | 80 | */ |
81 | #define MINIMUM_PEER_THRESHOLD 20 | 81 | #define MINIMUM_PEER_THRESHOLD 20 |
82 | 82 | ||
83 | #define DHT_MAX_RECENT 1000 | 83 | /** |
84 | 84 | * Number of requests we track at most (for routing replies). | |
85 | #define FIND_PEER_CALC_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) | 85 | */ |
86 | #define DHT_MAX_RECENT (1024 * 16) | ||
86 | 87 | ||
87 | /** | 88 | /** |
88 | * Default time to wait to send messages on behalf of other peers. | 89 | * Default time to wait to send messages on behalf of other peers. |
@@ -3714,12 +3715,6 @@ send_find_peer_message (void *cls, | |||
3714 | struct GNUNET_TIME_Relative next_send_time; | 3715 | struct GNUNET_TIME_Relative next_send_time; |
3715 | struct GNUNET_CONTAINER_BloomFilter *temp_bloom; | 3716 | struct GNUNET_CONTAINER_BloomFilter *temp_bloom; |
3716 | 3717 | ||
3717 | #if COUNT_INTERVAL | ||
3718 | struct GNUNET_TIME_Relative time_diff; | ||
3719 | struct GNUNET_TIME_Absolute end; | ||
3720 | double multiplier; | ||
3721 | double count_per_interval; | ||
3722 | #endif | ||
3723 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | 3718 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) |
3724 | return; | 3719 | return; |
3725 | 3720 | ||
@@ -3735,23 +3730,6 @@ send_find_peer_message (void *cls, | |||
3735 | } | 3730 | } |
3736 | 3731 | ||
3737 | increment_stats (STAT_FIND_PEER_START); | 3732 | increment_stats (STAT_FIND_PEER_START); |
3738 | #if COUNT_INTERVAL | ||
3739 | end = GNUNET_TIME_absolute_get (); | ||
3740 | time_diff = | ||
3741 | GNUNET_TIME_absolute_get_difference (find_peer_context.start, end); | ||
3742 | |||
3743 | if (time_diff.abs_value > FIND_PEER_CALC_INTERVAL.abs_value) | ||
3744 | { | ||
3745 | multiplier = time_diff.abs_value / FIND_PEER_CALC_INTERVAL.abs_value; | ||
3746 | count_per_interval = find_peer_context.count / multiplier; | ||
3747 | } | ||
3748 | else | ||
3749 | { | ||
3750 | multiplier = FIND_PEER_CALC_INTERVAL.abs_value / time_diff.abs_value; | ||
3751 | count_per_interval = find_peer_context.count * multiplier; | ||
3752 | } | ||
3753 | #endif | ||
3754 | |||
3755 | #if FIND_PEER_WITH_HELLO | 3733 | #if FIND_PEER_WITH_HELLO |
3756 | find_peer_msg = | 3734 | find_peer_msg = |
3757 | GNUNET_malloc (sizeof (struct GNUNET_DHT_FindPeerMessage) + | 3735 | GNUNET_malloc (sizeof (struct GNUNET_DHT_FindPeerMessage) + |