diff options
Diffstat (limited to 'src/fs/gnunet-service-fs_pr.c')
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index b624f536c..9171bfc2a 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -367,7 +367,7 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
367 | { | 367 | { |
368 | refresh_bloomfilter (pr); | 368 | refresh_bloomfilter (pr); |
369 | } | 369 | } |
370 | GNUNET_CONTAINER_multihashmap_put (pr_map, | 370 | GNUNET_CONTAINER_multihashmap_put (pr_map, |
371 | &pr->public_data.query, pr, | 371 | &pr->public_data.query, pr, |
372 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 372 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
373 | if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES)) | 373 | if (0 == (options & GSF_PRO_REQUEST_NEVER_EXPIRES)) |
@@ -482,7 +482,7 @@ GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | |||
482 | } | 482 | } |
483 | } | 483 | } |
484 | } | 484 | } |
485 | if (NULL != pr->gh) | 485 | if (NULL != pr->gh) |
486 | GNUNET_DHT_get_filter_known_results (pr->gh, | 486 | GNUNET_DHT_get_filter_known_results (pr->gh, |
487 | replies_seen_count, | 487 | replies_seen_count, |
488 | replies_seen); | 488 | replies_seen); |
@@ -828,8 +828,8 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
828 | GNUNET_TIME_absolute_get_duration (pr-> | 828 | GNUNET_TIME_absolute_get_duration (pr-> |
829 | public_data.start_time).rel_value_us); | 829 | public_data.start_time).rel_value_us); |
830 | if (GNUNET_YES != | 830 | if (GNUNET_YES != |
831 | GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, | 831 | GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, |
832 | prq->sender, | 832 | prq->sender, |
833 | &last_transmission)) | 833 | &last_transmission)) |
834 | last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | 834 | last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
835 | /* pass on to other peers / local clients */ | 835 | /* pass on to other peers / local clients */ |
@@ -890,10 +890,10 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
890 | prq->request_found = GNUNET_YES; | 890 | prq->request_found = GNUNET_YES; |
891 | /* finally, pass on to other peer / local client */ | 891 | /* finally, pass on to other peer / local client */ |
892 | if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, | 892 | if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, |
893 | prq->sender, | 893 | prq->sender, |
894 | &last_transmission)) | 894 | &last_transmission)) |
895 | last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | 895 | last_transmission.abs_value_us = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
896 | pr->rh (pr->rh_cls, prq->eval, pr, | 896 | pr->rh (pr->rh_cls, prq->eval, pr, |
897 | prq->anonymity_level, prq->expiration, | 897 | prq->anonymity_level, prq->expiration, |
898 | last_transmission, prq->type, prq->data, prq->size); | 898 | last_transmission, prq->type, prq->data, prq->size); |
899 | return GNUNET_YES; | 899 | return GNUNET_YES; |
@@ -934,7 +934,7 @@ struct PutMigrationContext | |||
934 | * @param msg NULL on success, otherwise an error message | 934 | * @param msg NULL on success, otherwise an error message |
935 | */ | 935 | */ |
936 | static void | 936 | static void |
937 | put_migration_continuation (void *cls, int success, | 937 | put_migration_continuation (void *cls, int success, |
938 | struct GNUNET_TIME_Absolute min_expiration, | 938 | struct GNUNET_TIME_Absolute min_expiration, |
939 | const char *msg) | 939 | const char *msg) |
940 | { | 940 | { |
@@ -947,13 +947,13 @@ put_migration_continuation (void *cls, int success, | |||
947 | { | 947 | { |
948 | if (GNUNET_SYSERR != success) | 948 | if (GNUNET_SYSERR != success) |
949 | { | 949 | { |
950 | GNUNET_LOAD_update (datastore_put_load, | 950 | GNUNET_LOAD_update (datastore_put_load, |
951 | GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us); | 951 | GNUNET_TIME_absolute_get_duration (pmc->start).rel_value_us); |
952 | } | 952 | } |
953 | else | 953 | else |
954 | { | 954 | { |
955 | /* on queue failure / timeout, increase the put load dramatically */ | 955 | /* on queue failure / timeout, increase the put load dramatically */ |
956 | GNUNET_LOAD_update (datastore_put_load, | 956 | GNUNET_LOAD_update (datastore_put_load, |
957 | GNUNET_TIME_UNIT_MINUTES.rel_value_us); | 957 | GNUNET_TIME_UNIT_MINUTES.rel_value_us); |
958 | } | 958 | } |
959 | } | 959 | } |
@@ -968,17 +968,17 @@ put_migration_continuation (void *cls, int success, | |||
968 | GNUNET_free (pmc); | 968 | GNUNET_free (pmc); |
969 | return; | 969 | return; |
970 | } | 970 | } |
971 | if ( (GNUNET_NO == success) && | 971 | if ( (GNUNET_NO == success) && |
972 | (GNUNET_NO == pmc->requested) && | 972 | (GNUNET_NO == pmc->requested) && |
973 | (NULL != cp) ) | 973 | (NULL != cp) ) |
974 | { | 974 | { |
975 | ppd = GSF_get_peer_performance_data_ (cp); | 975 | ppd = GSF_get_peer_performance_data_ (cp); |
976 | if (min_expiration.abs_value_us > 0) | 976 | if (min_expiration.abs_value_us > 0) |
977 | { | 977 | { |
978 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 978 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
979 | "Asking to stop migration for %s because datastore is full\n", | 979 | "Asking to stop migration for %s because datastore is full\n", |
980 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_expiration), GNUNET_YES)); | 980 | GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_expiration), GNUNET_YES)); |
981 | GSF_block_peer_migration_ (cp, min_expiration); | 981 | GSF_block_peer_migration_ (cp, min_expiration); |
982 | } | 982 | } |
983 | else | 983 | else |
984 | { | 984 | { |
@@ -989,7 +989,7 @@ put_migration_continuation (void *cls, int success, | |||
989 | mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, | 989 | mig_pause.rel_value_us = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, |
990 | ppd->migration_delay.rel_value_us); | 990 | ppd->migration_delay.rel_value_us); |
991 | ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); | 991 | ppd->migration_delay = GNUNET_TIME_relative_multiply (ppd->migration_delay, 2); |
992 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 992 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
993 | "Replicated content already exists locally, asking to stop migration for %s\n", | 993 | "Replicated content already exists locally, asking to stop migration for %s\n", |
994 | GNUNET_STRINGS_relative_time_to_string (mig_pause, GNUNET_YES)); | 994 | GNUNET_STRINGS_relative_time_to_string (mig_pause, GNUNET_YES)); |
995 | GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause)); | 995 | GSF_block_peer_migration_ (cp, GNUNET_TIME_relative_to_absolute (mig_pause)); |
@@ -1123,12 +1123,12 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr) | |||
1123 | xquery_size += sizeof (struct GNUNET_PeerIdentity); | 1123 | xquery_size += sizeof (struct GNUNET_PeerIdentity); |
1124 | } | 1124 | } |
1125 | pr->gh = | 1125 | pr->gh = |
1126 | GNUNET_DHT_get_start (GSF_dht, | 1126 | GNUNET_DHT_get_start (GSF_dht, |
1127 | pr->public_data.type, &pr->public_data.query, | 1127 | pr->public_data.type, &pr->public_data.query, |
1128 | DHT_GET_REPLICATION, | 1128 | DHT_GET_REPLICATION, |
1129 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, | 1129 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, |
1130 | xquery, xquery_size, &handle_dht_reply, pr); | 1130 | xquery, xquery_size, &handle_dht_reply, pr); |
1131 | if ( (NULL != pr->gh) && | 1131 | if ( (NULL != pr->gh) && |
1132 | (0 != pr->replies_seen_count) ) | 1132 | (0 != pr->replies_seen_count) ) |
1133 | GNUNET_DHT_get_filter_known_results (pr->gh, | 1133 | GNUNET_DHT_get_filter_known_results (pr->gh, |
1134 | pr->replies_seen_count, | 1134 | pr->replies_seen_count, |
@@ -1138,7 +1138,7 @@ GSF_dht_lookup_ (struct GSF_PendingRequest *pr) | |||
1138 | 1138 | ||
1139 | /** | 1139 | /** |
1140 | * Function called with a reply from the mesh. | 1140 | * Function called with a reply from the mesh. |
1141 | * | 1141 | * |
1142 | * @param cls the pending request struct | 1142 | * @param cls the pending request struct |
1143 | * @param type type of the block, ANY on error | 1143 | * @param type type of the block, ANY on error |
1144 | * @param expiration expiration time for the block | 1144 | * @param expiration expiration time for the block |
@@ -1698,7 +1698,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
1698 | test_put_load_too_high (prq.priority)); | 1698 | test_put_load_too_high (prq.priority)); |
1699 | } | 1699 | } |
1700 | putl = GNUNET_LOAD_get_load (datastore_put_load); | 1700 | putl = GNUNET_LOAD_get_load (datastore_put_load); |
1701 | if ( (NULL != cp) && | 1701 | if ( (NULL != cp) && |
1702 | (GNUNET_NO == prq.request_found) && | 1702 | (GNUNET_NO == prq.request_found) && |
1703 | ( (GNUNET_YES != active_to_migration) || | 1703 | ( (GNUNET_YES != active_to_migration) || |
1704 | (putl > 2.5 * (1 + prq.priority)) ) ) | 1704 | (putl > 2.5 * (1 + prq.priority)) ) ) |
@@ -1711,7 +1711,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
1711 | GNUNET_CRYPTO_random_u32 | 1711 | GNUNET_CRYPTO_random_u32 |
1712 | (GNUNET_CRYPTO_QUALITY_WEAK, | 1712 | (GNUNET_CRYPTO_QUALITY_WEAK, |
1713 | (unsigned int) (60000 * putl * putl))); | 1713 | (unsigned int) (60000 * putl * putl))); |
1714 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1714 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1715 | "Asking to stop migration for %s because of load %f and events %d/%d\n", | 1715 | "Asking to stop migration for %s because of load %f and events %d/%d\n", |
1716 | GNUNET_STRINGS_relative_time_to_string (block_time, | 1716 | GNUNET_STRINGS_relative_time_to_string (block_time, |
1717 | GNUNET_YES), | 1717 | GNUNET_YES), |