aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_pr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r--src/fs/gnunet-service-fs_pr.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index a78cbf287..627d376ef 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2009, 2010, 2011, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2009-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -373,7 +373,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options,
373 { 373 {
374 pr->hnode = 374 pr->hnode =
375 GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr, 375 GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap, pr,
376 pr->public_data.ttl.abs_value); 376 pr->public_data.ttl.abs_value_us);
377 /* make sure we don't track too many requests */ 377 /* make sure we don't track too many requests */
378 while (GNUNET_CONTAINER_heap_get_size (requests_by_expiration_heap) > 378 while (GNUNET_CONTAINER_heap_get_size (requests_by_expiration_heap) >
379 max_pending_requests) 379 max_pending_requests)
@@ -555,8 +555,8 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr,
555 pr->public_data.respect_offered += prio; 555 pr->public_data.respect_offered += prio;
556 gm->priority = htonl (prio); 556 gm->priority = htonl (prio);
557 now = GNUNET_TIME_absolute_get (); 557 now = GNUNET_TIME_absolute_get ();
558 ttl = (int64_t) (pr->public_data.ttl.abs_value - now.abs_value); 558 ttl = (int64_t) (pr->public_data.ttl.abs_value_us - now.abs_value_us);
559 gm->ttl = htonl (ttl / 1000); 559 gm->ttl = htonl (ttl / 1000LL / 1000LL);
560 gm->filter_mutator = htonl (pr->mingle); 560 gm->filter_mutator = htonl (pr->mingle);
561 gm->hash_bitmap = htonl (bm); 561 gm->hash_bitmap = htonl (bm);
562 gm->query = pr->public_data.query; 562 gm->query = pr->public_data.query;
@@ -825,12 +825,12 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
825 update_request_performance_data (prq, pr); 825 update_request_performance_data (prq, pr);
826 GNUNET_LOAD_update (GSF_rt_entry_lifetime, 826 GNUNET_LOAD_update (GSF_rt_entry_lifetime,
827 GNUNET_TIME_absolute_get_duration (pr-> 827 GNUNET_TIME_absolute_get_duration (pr->
828 public_data.start_time).rel_value); 828 public_data.start_time).rel_value_us);
829 if (GNUNET_YES != 829 if (GNUNET_YES !=
830 GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, 830 GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head,
831 prq->sender, 831 prq->sender,
832 &last_transmission)) 832 &last_transmission))
833 last_transmission.abs_value = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; 833 last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
834 /* pass on to other peers / local clients */ 834 /* pass on to other peers / local clients */
835 pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, 835 pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration,
836 last_transmission, prq->type, prq->data, prq->size); 836 last_transmission, prq->type, prq->data, prq->size);
@@ -891,7 +891,7 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
891 if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, 891 if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head,
892 prq->sender, 892 prq->sender,
893 &last_transmission)) 893 &last_transmission))
894 last_transmission.abs_value = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; 894 last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
895 pr->rh (pr->rh_cls, prq->eval, pr, 895 pr->rh (pr->rh_cls, prq->eval, pr,
896 prq->anonymity_level, prq->expiration, 896 prq->anonymity_level, prq->expiration,
897 last_transmission, prq->type, prq->data, prq->size); 897 last_transmission, prq->type, prq->data, prq->size);
@@ -947,13 +947,13 @@ put_migration_continuation (void *cls, int success,
947 if (GNUNET_SYSERR != success) 947 if (GNUNET_SYSERR != success)
948 { 948 {
949 GNUNET_LOAD_update (datastore_put_load, 949 GNUNET_LOAD_update (datastore_put_load,
950 GNUNET_TIME_absolute_get_duration (pmc->start).rel_value); 950 GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us);
951 } 951 }
952 else 952 else
953 { 953 {
954 /* on queue failure / timeout, increase the put load dramatically */ 954 /* on queue failure / timeout, increase the put load dramatically */
955 GNUNET_LOAD_update (datastore_put_load, 955 GNUNET_LOAD_update (datastore_put_load,
956 GNUNET_TIME_UNIT_MINUTES.rel_value); 956 GNUNET_TIME_UNIT_MINUTES.rel_value_us);
957 } 957 }
958 } 958 }
959 cp = GSF_peer_get_ (&pmc->origin); 959 cp = GSF_peer_get_ (&pmc->origin);
@@ -962,7 +962,7 @@ put_migration_continuation (void *cls, int success,
962 if (NULL != cp) 962 if (NULL != cp)
963 { 963 {
964 ppd = GSF_get_peer_performance_data_ (cp); 964 ppd = GSF_get_peer_performance_data_ (cp);
965 ppd->migration_delay.rel_value /= 2; 965 ppd->migration_delay.rel_value_us /= 2;
966 } 966 }
967 GNUNET_free (pmc); 967 GNUNET_free (pmc);
968 return; 968 return;
@@ -972,7 +972,7 @@ put_migration_continuation (void *cls, int success,
972 (NULL != cp) ) 972 (NULL != cp) )
973 { 973 {
974 ppd = GSF_get_peer_performance_data_ (cp); 974 ppd = GSF_get_peer_performance_data_ (cp);
975 if (min_expiration.abs_value > 0) 975 if (min_expiration.abs_value_us > 0)
976 { 976 {
977 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 977 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
978 "Asking to stop migration for %s because datastore is full\n", 978 "Asking to stop migration for %s because datastore is full\n",
@@ -985,8 +985,8 @@ put_migration_continuation (void *cls, int success,
985 ppd->migration_delay); 985 ppd->migration_delay);
986 ppd->migration_delay = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_HOURS, 986 ppd->migration_delay = GNUNET_TIME_relative_min (GNUNET_TIME_UNIT_HOURS,
987 ppd->migration_delay); 987 ppd->migration_delay);
988 mig_pause.rel_value = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 988 mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
989 ppd->migration_delay.rel_value); 989 ppd->migration_delay.rel_value_us);
990 ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); 990 ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2);
991 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 991 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
992 "Replicated content already exists locally, asking to stop migration for %s\n", 992 "Replicated content already exists locally, asking to stop migration for %s\n",
@@ -1711,8 +1711,9 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp,
1711 (GNUNET_CRYPTO_QUALITY_WEAK, 1711 (GNUNET_CRYPTO_QUALITY_WEAK,
1712 (unsigned int) (60000 * putl * putl))); 1712 (unsigned int) (60000 * putl * putl)));
1713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1714 "Asking to stop migration for %llu ms because of load %f and events %d/%d\n", 1714 "Asking to stop migration for %s because of load %f and events %d/%d\n",
1715 (unsigned long long) block_time.rel_value, 1715 GNUNET_STRINGS_relative_time_to_string (block_time,
1716 GNUNET_YES),
1716 putl, 1717 putl,
1717 active_to_migration, 1718 active_to_migration,
1718 (GNUNET_NO == prq.request_found)); 1719 (GNUNET_NO == prq.request_found));