aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-service-fs.c')
-rw-r--r--src/fs/gnunet-service-fs.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 2157ff5f5..9de8bca5c 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -56,7 +56,6 @@
56 */ 56 */
57#define TRUST_FLUSH_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5) 57#define TRUST_FLUSH_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
58 58
59
60/** 59/**
61 * Inverse of the probability that we will submit the same query 60 * Inverse of the probability that we will submit the same query
62 * to the same peer again. If the same peer already got the query 61 * to the same peer again. If the same peer already got the query
@@ -75,12 +74,9 @@
75 */ 74 */
76#define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45) 75#define MAX_TRANSMIT_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45)
77 76
78
79
80/** 77/**
81 * Maximum number of requests (from other peers) that we're 78 * Maximum number of requests (from other peers) that we're
82 * willing to have pending at any given point in time. 79 * willing to have pending at any given point in time.
83 * FIXME: set from configuration.
84 */ 80 */
85static uint64_t max_pending_requests = (32 * 1024); 81static uint64_t max_pending_requests = (32 * 1024);
86 82
@@ -3669,14 +3665,34 @@ main_init (struct GNUNET_SCHEDULER_Handle *s,
3669 0 }, 3665 0 },
3670 {NULL, NULL, 0, 0} 3666 {NULL, NULL, 0, 0}
3671 }; 3667 };
3668 unsigned long long enc = 128;
3672 3669
3673 sched = s; 3670 sched = s;
3674 cfg = c; 3671 cfg = c;
3675 stats = GNUNET_STATISTICS_create (sched, "fs", cfg); 3672 stats = GNUNET_STATISTICS_create (sched, "fs", cfg);
3676 min_migration_delay = GNUNET_TIME_UNIT_SECONDS; // FIXME: get from config 3673 min_migration_delay = GNUNET_TIME_UNIT_SECONDS;
3677 connected_peers = GNUNET_CONTAINER_multihashmap_create (128); // FIXME: get size from config 3674 if ( (GNUNET_OK !=
3678 query_request_map = GNUNET_CONTAINER_multihashmap_create (128); // FIXME: get size from config 3675 GNUNET_CONFIGURATION_get_value_number (cfg,
3679 peer_request_map = GNUNET_CONTAINER_multihashmap_create (128); // FIXME: get size from config 3676 "fs",
3677 "MAX_PENDING_REQUESTS",
3678 &max_pending_requests)) ||
3679 (GNUNET_OK !=
3680 GNUNET_CONFIGURATION_get_value_number (cfg,
3681 "fs",
3682 "EXPECTED_NEIGHBOUR_COUNT",
3683 &enc)) ||
3684 (GNUNET_OK !=
3685 GNUNET_CONFIGURATION_get_value_time (cfg,
3686 "fs",
3687 "MIN_MIGRATION_DELAY",
3688 &min_migration_delay)) )
3689 {
3690 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
3691 _("Configuration fails to specify certain parameters, assuming default values."));
3692 }
3693 connected_peers = GNUNET_CONTAINER_multihashmap_create (enc);
3694 query_request_map = GNUNET_CONTAINER_multihashmap_create (max_pending_requests);
3695 peer_request_map = GNUNET_CONTAINER_multihashmap_create (enc);
3680 requests_by_expiration_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); 3696 requests_by_expiration_heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
3681 core = GNUNET_CORE_connect (sched, 3697 core = GNUNET_CORE_connect (sched,
3682 cfg, 3698 cfg,