diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 10:08:46 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-27 10:08:46 +0000 |
commit | d6dbee55aed867e1d4d519fea9e3768d85a19d88 (patch) | |
tree | ed158a299d6ddcc29989936f36c6e87ee6ddeffa /src | |
parent | f47cc990ea9a89cb39acc9c6a9789e6474197708 (diff) | |
download | gnunet-d6dbee55aed867e1d4d519fea9e3768d85a19d88.tar.gz gnunet-d6dbee55aed867e1d4d519fea9e3768d85a19d88.zip |
Refactoring gnunet time
Diffstat (limited to 'src')
-rw-r--r-- | src/dht/dht_api.c | 13 | ||||
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 20 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht.c | 44 | ||||
-rw-r--r-- | src/dht/test_dht_api.c | 2 |
4 files changed, 42 insertions, 37 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 3c8ed9434..ea70b9000 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -861,14 +861,16 @@ void | |||
861 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | 861 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, |
862 | struct GNUNET_TIME_Relative frequency) | 862 | struct GNUNET_TIME_Relative frequency) |
863 | { | 863 | { |
864 | if (frequency.value > UINT16_MAX) | 864 | /* |
865 | if (frequency.abs_value > UINT16_MAX) | ||
865 | { | 866 | { |
866 | GNUNET_break (0); | 867 | GNUNET_break (0); |
867 | return; | 868 | return; |
868 | } | 869 | } |
869 | send_control_message (handle, | 870 | send_control_message (handle, |
870 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET, frequency.value, | 871 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET, frequency.abs_value, |
871 | NULL, NULL); | 872 | NULL, NULL); |
873 | */ | ||
872 | } | 874 | } |
873 | 875 | ||
874 | /** | 876 | /** |
@@ -882,14 +884,17 @@ void | |||
882 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | 884 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, |
883 | struct GNUNET_TIME_Relative frequency) | 885 | struct GNUNET_TIME_Relative frequency) |
884 | { | 886 | { |
885 | if (frequency.value > UINT16_MAX) | 887 | /* |
888 | if (frequency.abs_value > UINT16_MAX) | ||
886 | { | 889 | { |
887 | GNUNET_break (0); | 890 | GNUNET_break (0); |
888 | return; | 891 | return; |
889 | } | 892 | } |
893 | |||
890 | send_control_message (handle, | 894 | send_control_message (handle, |
891 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT, frequency.value, | 895 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT, frequency.abs_value, |
892 | NULL, NULL); | 896 | NULL, NULL); |
897 | */ | ||
893 | } | 898 | } |
894 | 899 | ||
895 | 900 | ||
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index 4424a45f3..649d8ff13 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -1065,7 +1065,7 @@ decrement_find_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
1065 | test_find_peer->find_peer_context->outstanding--; | 1065 | test_find_peer->find_peer_context->outstanding--; |
1066 | test_find_peer->find_peer_context->total--; | 1066 | test_find_peer->find_peer_context->total--; |
1067 | if ((0 == test_find_peer->find_peer_context->total) && | 1067 | if ((0 == test_find_peer->find_peer_context->total) && |
1068 | (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).value > 60)) | 1068 | (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).rel_value > 60)) |
1069 | { | 1069 | { |
1070 | GNUNET_SCHEDULER_add_now(sched, &count_new_peers, test_find_peer->find_peer_context); | 1070 | GNUNET_SCHEDULER_add_now(sched, &count_new_peers, test_find_peer->find_peer_context); |
1071 | } | 1071 | } |
@@ -1101,7 +1101,7 @@ send_find_peer_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext * t | |||
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | test_find_peer->find_peer_context->outstanding++; | 1103 | test_find_peer->find_peer_context->outstanding++; |
1104 | if (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).value == 0) | 1104 | if (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).rel_value == 0) |
1105 | { | 1105 | { |
1106 | GNUNET_SCHEDULER_add_now(sched, &decrement_find_peers, test_find_peer); | 1106 | GNUNET_SCHEDULER_add_now(sched, &decrement_find_peers, test_find_peer); |
1107 | return; | 1107 | return; |
@@ -1192,13 +1192,13 @@ static int iterate_min_heap_peers (void *cls, | |||
1192 | /** Just try to connect the peers, don't worry about callbacks, etc. **/ | 1192 | /** Just try to connect the peers, don't worry about callbacks, etc. **/ |
1193 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Peer %s has 0 connections. Trying to connect to %s...\n", GNUNET_i2s(&peer_count->peer_id), d2->shortname); | 1193 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Peer %s has 0 connections. Trying to connect to %s...\n", GNUNET_i2s(&peer_count->peer_id), d2->shortname); |
1194 | timeout = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, DEFAULT_CONNECT_TIMEOUT); | 1194 | timeout = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, DEFAULT_CONNECT_TIMEOUT); |
1195 | if (GNUNET_TIME_relative_to_absolute(timeout).value > find_peer_context->endtime.value) | 1195 | if (GNUNET_TIME_relative_to_absolute(timeout).abs_value > find_peer_context->endtime.abs_value) |
1196 | { | 1196 | { |
1197 | timeout = GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime); | 1197 | timeout = GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime); |
1198 | } | 1198 | } |
1199 | GNUNET_TESTING_daemons_connect(d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, NULL, NULL); | 1199 | GNUNET_TESTING_daemons_connect(d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, NULL, NULL); |
1200 | } | 1200 | } |
1201 | if (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0) | 1201 | if (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0) |
1202 | return GNUNET_YES; | 1202 | return GNUNET_YES; |
1203 | else | 1203 | else |
1204 | return GNUNET_NO; | 1204 | return GNUNET_NO; |
@@ -1286,13 +1286,13 @@ count_peers_churn_cb (void *cls, | |||
1286 | * these are very specialized cases. | 1286 | * these are very specialized cases. |
1287 | */ | 1287 | */ |
1288 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Out of %u peers, fewest connections is %d\n", GNUNET_CONTAINER_heap_get_size(find_peer_context->peer_min_heap), peer_count->count); | 1288 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Out of %u peers, fewest connections is %d\n", GNUNET_CONTAINER_heap_get_size(find_peer_context->peer_min_heap), peer_count->count); |
1289 | if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0)) | 1289 | if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0)) |
1290 | { | 1290 | { |
1291 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); | 1291 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); |
1292 | GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, &iterate_min_heap_peers, find_peer_context); | 1292 | GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, &iterate_min_heap_peers, find_peer_context); |
1293 | GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context); | 1293 | GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context); |
1294 | } | 1294 | } |
1295 | else if ((GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0) && (find_peer_context->last_sent != 0)) | 1295 | else if ((GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0) && (find_peer_context->last_sent != 0)) |
1296 | { | 1296 | { |
1297 | GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context); | 1297 | GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context); |
1298 | } | 1298 | } |
@@ -1909,7 +1909,7 @@ count_peers_cb (void *cls, | |||
1909 | if ((find_peer_context->last_sent > 8) && | 1909 | if ((find_peer_context->last_sent > 8) && |
1910 | (find_peer_context->current_peers - find_peer_context->previous_peers > FIND_PEER_THRESHOLD) && | 1910 | (find_peer_context->current_peers - find_peer_context->previous_peers > FIND_PEER_THRESHOLD) && |
1911 | (find_peer_context->current_peers < 2 * connection_estimate(num_peers, DEFAULT_BUCKET_SIZE)) && | 1911 | (find_peer_context->current_peers < 2 * connection_estimate(num_peers, DEFAULT_BUCKET_SIZE)) && |
1912 | (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0)) | 1912 | (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0)) |
1913 | { | 1913 | { |
1914 | GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context); | 1914 | GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context); |
1915 | } | 1915 | } |
@@ -2783,7 +2783,7 @@ run (void *cls, | |||
2783 | &temp_config_number)) | 2783 | &temp_config_number)) |
2784 | all_get_timeout = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, temp_config_number); | 2784 | all_get_timeout = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, temp_config_number); |
2785 | else | 2785 | else |
2786 | all_get_timeout.value = get_timeout.value * num_gets; | 2786 | all_get_timeout.rel_value = get_timeout.rel_value * num_gets; |
2787 | 2787 | ||
2788 | if (GNUNET_OK == | 2788 | if (GNUNET_OK == |
2789 | GNUNET_CONFIGURATION_get_value_number (cfg, "dht_testing", "get_delay", | 2789 | GNUNET_CONFIGURATION_get_value_number (cfg, "dht_testing", "get_delay", |
@@ -3011,8 +3011,8 @@ run (void *cls, | |||
3011 | trial_info.malicious_getters = malicious_getters; | 3011 | trial_info.malicious_getters = malicious_getters; |
3012 | trial_info.malicious_putters = malicious_putters; | 3012 | trial_info.malicious_putters = malicious_putters; |
3013 | trial_info.malicious_droppers = malicious_droppers; | 3013 | trial_info.malicious_droppers = malicious_droppers; |
3014 | trial_info.malicious_get_frequency = malicious_get_frequency.value; | 3014 | trial_info.malicious_get_frequency = malicious_get_frequency.rel_value; |
3015 | trial_info.malicious_put_frequency = malicious_put_frequency.value; | 3015 | trial_info.malicious_put_frequency = malicious_put_frequency.rel_value; |
3016 | trial_info.stop_closest = stop_closest; | 3016 | trial_info.stop_closest = stop_closest; |
3017 | trial_info.stop_found = stop_found; | 3017 | trial_info.stop_found = stop_found; |
3018 | trial_info.strict_kademlia = strict_kademlia; | 3018 | trial_info.strict_kademlia = strict_kademlia; |
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 02cf9ae90..8b5de2157 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -947,7 +947,7 @@ static struct GNUNET_TIME_Relative get_average_send_delay() | |||
947 | for (i = 0; i < MAX_REPLY_TIMES; i++) | 947 | for (i = 0; i < MAX_REPLY_TIMES; i++) |
948 | { | 948 | { |
949 | average_time = GNUNET_TIME_relative_add(average_time, reply_times[i]); | 949 | average_time = GNUNET_TIME_relative_add(average_time, reply_times[i]); |
950 | if (reply_times[i].value == (uint64_t)0) | 950 | if (reply_times[i].abs_value == (uint64_t)0) |
951 | continue; | 951 | continue; |
952 | else | 952 | else |
953 | divisor++; | 953 | divisor++; |
@@ -958,7 +958,7 @@ static struct GNUNET_TIME_Relative get_average_send_delay() | |||
958 | } | 958 | } |
959 | 959 | ||
960 | average_time = GNUNET_TIME_relative_divide(average_time, divisor); | 960 | average_time = GNUNET_TIME_relative_divide(average_time, divisor); |
961 | fprintf(stderr, "Avg send delay: %u sends is %llu\n", divisor, (long long unsigned int)average_time.value); | 961 | fprintf(stderr, "Avg send delay: %u sends is %llu\n", divisor, (long long unsigned int)average_time.abs_value); |
962 | return average_time; | 962 | return average_time; |
963 | } | 963 | } |
964 | #endif | 964 | #endif |
@@ -973,9 +973,9 @@ static void decrease_max_send_delay(struct GNUNET_TIME_Relative max_time) | |||
973 | unsigned int i; | 973 | unsigned int i; |
974 | for (i = 0; i < MAX_REPLY_TIMES; i++) | 974 | for (i = 0; i < MAX_REPLY_TIMES; i++) |
975 | { | 975 | { |
976 | if (reply_times[i].value == max_time.value) | 976 | if (reply_times[i].rel_value == max_time.rel_value) |
977 | { | 977 | { |
978 | reply_times[i].value = reply_times[i].value / 2; | 978 | reply_times[i].rel_value = reply_times[i].rel_value / 2; |
979 | return; | 979 | return; |
980 | } | 980 | } |
981 | } | 981 | } |
@@ -995,12 +995,12 @@ static struct GNUNET_TIME_Relative get_max_send_delay() | |||
995 | 995 | ||
996 | for (i = 0; i < MAX_REPLY_TIMES; i++) | 996 | for (i = 0; i < MAX_REPLY_TIMES; i++) |
997 | { | 997 | { |
998 | if (reply_times[i].value > max_time.value) | 998 | if (reply_times[i].rel_value > max_time.rel_value) |
999 | max_time.value = reply_times[i].value; | 999 | max_time.rel_value = reply_times[i].rel_value; |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | if (max_time.value > MAX_REQUEST_TIME.value) | 1002 | if (max_time.rel_value > MAX_REQUEST_TIME.rel_value) |
1003 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Max send delay was %llu\n", (long long unsigned int)max_time.value); | 1003 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Max send delay was %llu\n", (long long unsigned int)max_time.rel_value); |
1004 | return max_time; | 1004 | return max_time; |
1005 | } | 1005 | } |
1006 | 1006 | ||
@@ -3413,7 +3413,7 @@ static int cache_response(struct DHT_MessageContext *msg_ctx) | |||
3413 | } | 3413 | } |
3414 | if ((pos != NULL) && (pos->client == msg_ctx->client)) /* Seen this already */ | 3414 | if ((pos != NULL) && (pos->client == msg_ctx->client)) /* Seen this already */ |
3415 | { | 3415 | { |
3416 | GNUNET_CONTAINER_heap_update_cost(forward_list.minHeap, pos->hnode, now.value); | 3416 | GNUNET_CONTAINER_heap_update_cost(forward_list.minHeap, pos->hnode, now.abs_value); |
3417 | return GNUNET_NO; | 3417 | return GNUNET_NO; |
3418 | } | 3418 | } |
3419 | } | 3419 | } |
@@ -3435,7 +3435,7 @@ static int cache_response(struct DHT_MessageContext *msg_ctx) | |||
3435 | source_info->client = msg_ctx->client; | 3435 | source_info->client = msg_ctx->client; |
3436 | now = GNUNET_TIME_absolute_get_forever(); | 3436 | now = GNUNET_TIME_absolute_get_forever(); |
3437 | } | 3437 | } |
3438 | source_info->hnode = GNUNET_CONTAINER_heap_insert(forward_list.minHeap, source_info, now.value); | 3438 | source_info->hnode = GNUNET_CONTAINER_heap_insert(forward_list.minHeap, source_info, now.abs_value); |
3439 | #if DEBUG_DHT > 1 | 3439 | #if DEBUG_DHT > 1 |
3440 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3440 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3441 | "`%s:%s': Created new forward source info for %s uid %llu\n", my_short_id, | 3441 | "`%s:%s': Created new forward source info for %s uid %llu\n", my_short_id, |
@@ -3554,7 +3554,7 @@ route_message(const struct GNUNET_MessageHeader *msg, | |||
3554 | recent_req->uid = message_context->unique_id; | 3554 | recent_req->uid = message_context->unique_id; |
3555 | memcpy(&recent_req->key, &message_context->key, sizeof(GNUNET_HashCode)); | 3555 | memcpy(&recent_req->key, &message_context->key, sizeof(GNUNET_HashCode)); |
3556 | recent_req->remove_task = GNUNET_SCHEDULER_add_delayed(sched, DEFAULT_RECENT_REMOVAL, &remove_recent, recent_req); | 3556 | recent_req->remove_task = GNUNET_SCHEDULER_add_delayed(sched, DEFAULT_RECENT_REMOVAL, &remove_recent, recent_req); |
3557 | recent_req->heap_node = GNUNET_CONTAINER_heap_insert(recent.minHeap, recent_req, GNUNET_TIME_absolute_get().value); | 3557 | recent_req->heap_node = GNUNET_CONTAINER_heap_insert(recent.minHeap, recent_req, GNUNET_TIME_absolute_get().abs_value); |
3558 | recent_req->bloom = GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, DHT_BLOOM_K); | 3558 | recent_req->bloom = GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, DHT_BLOOM_K); |
3559 | GNUNET_CONTAINER_multihashmap_put(recent.hashmap, &unique_hash, recent_req, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 3559 | GNUNET_CONTAINER_multihashmap_put(recent.hashmap, &unique_hash, recent_req, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
3560 | } | 3560 | } |
@@ -4008,14 +4008,14 @@ send_find_peer_message (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc | |||
4008 | end = GNUNET_TIME_absolute_get(); | 4008 | end = GNUNET_TIME_absolute_get(); |
4009 | time_diff = GNUNET_TIME_absolute_get_difference(find_peer_context.start, end); | 4009 | time_diff = GNUNET_TIME_absolute_get_difference(find_peer_context.start, end); |
4010 | 4010 | ||
4011 | if (time_diff.value > FIND_PEER_CALC_INTERVAL.value) | 4011 | if (time_diff.abs_value > FIND_PEER_CALC_INTERVAL.abs_value) |
4012 | { | 4012 | { |
4013 | multiplier = time_diff.value / FIND_PEER_CALC_INTERVAL.value; | 4013 | multiplier = time_diff.abs_value / FIND_PEER_CALC_INTERVAL.abs_value; |
4014 | count_per_interval = find_peer_context.count / multiplier; | 4014 | count_per_interval = find_peer_context.count / multiplier; |
4015 | } | 4015 | } |
4016 | else | 4016 | else |
4017 | { | 4017 | { |
4018 | multiplier = FIND_PEER_CALC_INTERVAL.value / time_diff.value; | 4018 | multiplier = FIND_PEER_CALC_INTERVAL.abs_value / time_diff.abs_value; |
4019 | count_per_interval = find_peer_context.count * multiplier; | 4019 | count_per_interval = find_peer_context.count * multiplier; |
4020 | } | 4020 | } |
4021 | #endif | 4021 | #endif |
@@ -4049,18 +4049,18 @@ send_find_peer_message (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc | |||
4049 | "FIND PEER"); | 4049 | "FIND PEER"); |
4050 | if (newly_found_peers < bucket_size) | 4050 | if (newly_found_peers < bucket_size) |
4051 | { | 4051 | { |
4052 | next_send_time.value = (DHT_MAXIMUM_FIND_PEER_INTERVAL.value / 2) + | 4052 | next_send_time.rel_value = (DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value / 2) + |
4053 | GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG, | 4053 | GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG, |
4054 | DHT_MAXIMUM_FIND_PEER_INTERVAL.value / 2); | 4054 | DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value / 2); |
4055 | } | 4055 | } |
4056 | else | 4056 | else |
4057 | { | 4057 | { |
4058 | next_send_time.value = DHT_MINIMUM_FIND_PEER_INTERVAL.value + | 4058 | next_send_time.rel_value = DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value + |
4059 | GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG, | 4059 | GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG, |
4060 | DHT_MAXIMUM_FIND_PEER_INTERVAL.value - DHT_MINIMUM_FIND_PEER_INTERVAL.value); | 4060 | DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value - DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value); |
4061 | } | 4061 | } |
4062 | 4062 | ||
4063 | GNUNET_assert (next_send_time.value != 0); | 4063 | GNUNET_assert (next_send_time.rel_value != 0); |
4064 | find_peer_context.count = 0; | 4064 | find_peer_context.count = 0; |
4065 | newly_found_peers = 0; | 4065 | newly_found_peers = 0; |
4066 | find_peer_context.start = GNUNET_TIME_absolute_get(); | 4066 | find_peer_context.start = GNUNET_TIME_absolute_get(); |
@@ -4257,7 +4257,7 @@ handle_dht_p2p_route_request (void *cls, | |||
4257 | struct GNUNET_MessageHeader *enc_msg = (struct GNUNET_MessageHeader *)&incoming[1]; | 4257 | struct GNUNET_MessageHeader *enc_msg = (struct GNUNET_MessageHeader *)&incoming[1]; |
4258 | struct DHT_MessageContext *message_context; | 4258 | struct DHT_MessageContext *message_context; |
4259 | 4259 | ||
4260 | if (get_max_send_delay().value > MAX_REQUEST_TIME.value) | 4260 | if (get_max_send_delay().rel_value > MAX_REQUEST_TIME.rel_value) |
4261 | { | 4261 | { |
4262 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Sending of previous replies took too long, backing off!\n"); | 4262 | GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Sending of previous replies took too long, backing off!\n"); |
4263 | increment_stats("# route requests dropped due to high load"); | 4263 | increment_stats("# route requests dropped due to high load"); |
@@ -4791,9 +4791,9 @@ run (void *cls, | |||
4791 | recent.minHeap = GNUNET_CONTAINER_heap_create(GNUNET_CONTAINER_HEAP_ORDER_MIN); | 4791 | recent.minHeap = GNUNET_CONTAINER_heap_create(GNUNET_CONTAINER_HEAP_ORDER_MIN); |
4792 | if (GNUNET_YES == do_find_peer) | 4792 | if (GNUNET_YES == do_find_peer) |
4793 | { | 4793 | { |
4794 | next_send_time.value = DHT_MINIMUM_FIND_PEER_INTERVAL.value + | 4794 | next_send_time.rel_value = DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value + |
4795 | GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG, | 4795 | GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG, |
4796 | (DHT_MAXIMUM_FIND_PEER_INTERVAL.value / 2) - DHT_MINIMUM_FIND_PEER_INTERVAL.value); | 4796 | (DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value / 2) - DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value); |
4797 | find_peer_context.start = GNUNET_TIME_absolute_get(); | 4797 | find_peer_context.start = GNUNET_TIME_absolute_get(); |
4798 | GNUNET_SCHEDULER_add_delayed (sched, | 4798 | GNUNET_SCHEDULER_add_delayed (sched, |
4799 | next_send_time, | 4799 | next_send_time, |
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 3d4e8dfb1..2145be843 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c | |||
@@ -249,7 +249,7 @@ retry_find_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
249 | GNUNET_HashCode hash; | 249 | GNUNET_HashCode hash; |
250 | memset (&hash, 42, sizeof (GNUNET_HashCode)); | 250 | memset (&hash, 42, sizeof (GNUNET_HashCode)); |
251 | 251 | ||
252 | if (GNUNET_TIME_absolute_get_remaining(retry_ctx->real_timeout).value > 0) | 252 | if (GNUNET_TIME_absolute_get_remaining(retry_ctx->real_timeout).rel_value > 0) |
253 | { | 253 | { |
254 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 254 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
255 | "test_find_peer timed out, retrying!\n"); | 255 | "test_find_peer timed out, retrying!\n"); |