test_find_peer->find_peer_context->outstanding--;
test_find_peer->find_peer_context->total--;
if ((0 == test_find_peer->find_peer_context->total) &&
- (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).value > 60))
+ (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).rel_value > 60))
{
GNUNET_SCHEDULER_add_now(sched, &count_new_peers, test_find_peer->find_peer_context);
}
}
test_find_peer->find_peer_context->outstanding++;
- if (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).value == 0)
+ if (GNUNET_TIME_absolute_get_remaining(test_find_peer->find_peer_context->endtime).rel_value == 0)
{
GNUNET_SCHEDULER_add_now(sched, &decrement_find_peers, test_find_peer);
return;
/** Just try to connect the peers, don't worry about callbacks, etc. **/
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);
timeout = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, DEFAULT_CONNECT_TIMEOUT);
- if (GNUNET_TIME_relative_to_absolute(timeout).value > find_peer_context->endtime.value)
+ if (GNUNET_TIME_relative_to_absolute(timeout).abs_value > find_peer_context->endtime.abs_value)
{
timeout = GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime);
}
GNUNET_TESTING_daemons_connect(d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, NULL, NULL);
}
- if (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0)
+ if (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0)
return GNUNET_YES;
else
return GNUNET_NO;
* these are very specialized cases.
*/
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);
- if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0))
+ if ((peer_count->count == 0) && (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0))
{
GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peer(s) at random to connect to!\n");
GNUNET_CONTAINER_heap_iterate (find_peer_context->peer_min_heap, &iterate_min_heap_peers, find_peer_context);
GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context);
}
- else if ((GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0) && (find_peer_context->last_sent != 0))
+ else if ((GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0) && (find_peer_context->last_sent != 0))
{
GNUNET_SCHEDULER_add_now(sched, &schedule_churn_find_peer_requests, find_peer_context);
}
if ((find_peer_context->last_sent > 8) &&
(find_peer_context->current_peers - find_peer_context->previous_peers > FIND_PEER_THRESHOLD) &&
(find_peer_context->current_peers < 2 * connection_estimate(num_peers, DEFAULT_BUCKET_SIZE)) &&
- (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).value > 0))
+ (GNUNET_TIME_absolute_get_remaining(find_peer_context->endtime).rel_value > 0))
{
GNUNET_SCHEDULER_add_now(sched, &schedule_find_peer_requests, find_peer_context);
}
&temp_config_number))
all_get_timeout = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, temp_config_number);
else
- all_get_timeout.value = get_timeout.value * num_gets;
+ all_get_timeout.rel_value = get_timeout.rel_value * num_gets;
if (GNUNET_OK ==
GNUNET_CONFIGURATION_get_value_number (cfg, "dht_testing", "get_delay",
trial_info.malicious_getters = malicious_getters;
trial_info.malicious_putters = malicious_putters;
trial_info.malicious_droppers = malicious_droppers;
- trial_info.malicious_get_frequency = malicious_get_frequency.value;
- trial_info.malicious_put_frequency = malicious_put_frequency.value;
+ trial_info.malicious_get_frequency = malicious_get_frequency.rel_value;
+ trial_info.malicious_put_frequency = malicious_put_frequency.rel_value;
trial_info.stop_closest = stop_closest;
trial_info.stop_found = stop_found;
trial_info.strict_kademlia = strict_kademlia;
for (i = 0; i < MAX_REPLY_TIMES; i++)
{
average_time = GNUNET_TIME_relative_add(average_time, reply_times[i]);
- if (reply_times[i].value == (uint64_t)0)
+ if (reply_times[i].abs_value == (uint64_t)0)
continue;
else
divisor++;
}
average_time = GNUNET_TIME_relative_divide(average_time, divisor);
- fprintf(stderr, "Avg send delay: %u sends is %llu\n", divisor, (long long unsigned int)average_time.value);
+ fprintf(stderr, "Avg send delay: %u sends is %llu\n", divisor, (long long unsigned int)average_time.abs_value);
return average_time;
}
#endif
unsigned int i;
for (i = 0; i < MAX_REPLY_TIMES; i++)
{
- if (reply_times[i].value == max_time.value)
+ if (reply_times[i].rel_value == max_time.rel_value)
{
- reply_times[i].value = reply_times[i].value / 2;
+ reply_times[i].rel_value = reply_times[i].rel_value / 2;
return;
}
}
for (i = 0; i < MAX_REPLY_TIMES; i++)
{
- if (reply_times[i].value > max_time.value)
- max_time.value = reply_times[i].value;
+ if (reply_times[i].rel_value > max_time.rel_value)
+ max_time.rel_value = reply_times[i].rel_value;
}
- if (max_time.value > MAX_REQUEST_TIME.value)
- GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Max send delay was %llu\n", (long long unsigned int)max_time.value);
+ if (max_time.rel_value > MAX_REQUEST_TIME.rel_value)
+ GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Max send delay was %llu\n", (long long unsigned int)max_time.rel_value);
return max_time;
}
}
if ((pos != NULL) && (pos->client == msg_ctx->client)) /* Seen this already */
{
- GNUNET_CONTAINER_heap_update_cost(forward_list.minHeap, pos->hnode, now.value);
+ GNUNET_CONTAINER_heap_update_cost(forward_list.minHeap, pos->hnode, now.abs_value);
return GNUNET_NO;
}
}
source_info->client = msg_ctx->client;
now = GNUNET_TIME_absolute_get_forever();
}
- source_info->hnode = GNUNET_CONTAINER_heap_insert(forward_list.minHeap, source_info, now.value);
+ source_info->hnode = GNUNET_CONTAINER_heap_insert(forward_list.minHeap, source_info, now.abs_value);
#if DEBUG_DHT > 1
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"`%s:%s': Created new forward source info for %s uid %llu\n", my_short_id,
recent_req->uid = message_context->unique_id;
memcpy(&recent_req->key, &message_context->key, sizeof(GNUNET_HashCode));
recent_req->remove_task = GNUNET_SCHEDULER_add_delayed(sched, DEFAULT_RECENT_REMOVAL, &remove_recent, recent_req);
- recent_req->heap_node = GNUNET_CONTAINER_heap_insert(recent.minHeap, recent_req, GNUNET_TIME_absolute_get().value);
+ recent_req->heap_node = GNUNET_CONTAINER_heap_insert(recent.minHeap, recent_req, GNUNET_TIME_absolute_get().abs_value);
recent_req->bloom = GNUNET_CONTAINER_bloomfilter_init (NULL, DHT_BLOOM_SIZE, DHT_BLOOM_K);
GNUNET_CONTAINER_multihashmap_put(recent.hashmap, &unique_hash, recent_req, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
}
end = GNUNET_TIME_absolute_get();
time_diff = GNUNET_TIME_absolute_get_difference(find_peer_context.start, end);
- if (time_diff.value > FIND_PEER_CALC_INTERVAL.value)
+ if (time_diff.abs_value > FIND_PEER_CALC_INTERVAL.abs_value)
{
- multiplier = time_diff.value / FIND_PEER_CALC_INTERVAL.value;
+ multiplier = time_diff.abs_value / FIND_PEER_CALC_INTERVAL.abs_value;
count_per_interval = find_peer_context.count / multiplier;
}
else
{
- multiplier = FIND_PEER_CALC_INTERVAL.value / time_diff.value;
+ multiplier = FIND_PEER_CALC_INTERVAL.abs_value / time_diff.abs_value;
count_per_interval = find_peer_context.count * multiplier;
}
#endif
"FIND PEER");
if (newly_found_peers < bucket_size)
{
- next_send_time.value = (DHT_MAXIMUM_FIND_PEER_INTERVAL.value / 2) +
+ next_send_time.rel_value = (DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value / 2) +
GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG,
- DHT_MAXIMUM_FIND_PEER_INTERVAL.value / 2);
+ DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value / 2);
}
else
{
- next_send_time.value = DHT_MINIMUM_FIND_PEER_INTERVAL.value +
+ next_send_time.rel_value = DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value +
GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG,
- DHT_MAXIMUM_FIND_PEER_INTERVAL.value - DHT_MINIMUM_FIND_PEER_INTERVAL.value);
+ DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value - DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value);
}
- GNUNET_assert (next_send_time.value != 0);
+ GNUNET_assert (next_send_time.rel_value != 0);
find_peer_context.count = 0;
newly_found_peers = 0;
find_peer_context.start = GNUNET_TIME_absolute_get();
struct GNUNET_MessageHeader *enc_msg = (struct GNUNET_MessageHeader *)&incoming[1];
struct DHT_MessageContext *message_context;
- if (get_max_send_delay().value > MAX_REQUEST_TIME.value)
+ if (get_max_send_delay().rel_value > MAX_REQUEST_TIME.rel_value)
{
GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Sending of previous replies took too long, backing off!\n");
increment_stats("# route requests dropped due to high load");
recent.minHeap = GNUNET_CONTAINER_heap_create(GNUNET_CONTAINER_HEAP_ORDER_MIN);
if (GNUNET_YES == do_find_peer)
{
- next_send_time.value = DHT_MINIMUM_FIND_PEER_INTERVAL.value +
+ next_send_time.rel_value = DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value +
GNUNET_CRYPTO_random_u64(GNUNET_CRYPTO_QUALITY_STRONG,
- (DHT_MAXIMUM_FIND_PEER_INTERVAL.value / 2) - DHT_MINIMUM_FIND_PEER_INTERVAL.value);
+ (DHT_MAXIMUM_FIND_PEER_INTERVAL.rel_value / 2) - DHT_MINIMUM_FIND_PEER_INTERVAL.rel_value);
find_peer_context.start = GNUNET_TIME_absolute_get();
GNUNET_SCHEDULER_add_delayed (sched,
next_send_time,