aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO5
-rw-r--r--contrib/defaults.conf3
-rw-r--r--src/fs/fs_test_lib.c6
-rw-r--r--src/fs/gnunet-service-fs.c16
4 files changed, 23 insertions, 7 deletions
diff --git a/TODO b/TODO
index ba98e6d9e..83ee0b839 100644
--- a/TODO
+++ b/TODO
@@ -15,11 +15,6 @@
15 + insert 15 + insert
16 + download 16 + download
17 + search 17 + search
18 - exclude content that will "soon" expire from migration
19 - make migration data rate & datastore IO-rate configurable
20 - exclude certain peers as targets (based on hash values) in each
21 iteration => same peer can only be picked every n-th iteration
22 for the same content => fewer duplicate sending!
23* GNUNET-GTK: [CG] 18* GNUNET-GTK: [CG]
24 - figure out where in the GUI we should show active upload operations and allow aborts 19 - figure out where in the GUI we should show active upload operations and allow aborts
25 - handle events: 20 - handle events:
diff --git a/contrib/defaults.conf b/contrib/defaults.conf
index 9b083ac3b..621230c73 100644
--- a/contrib/defaults.conf
+++ b/contrib/defaults.conf
@@ -286,6 +286,9 @@ UNIXPATH = /tmp/gnunet-service-fs.sock
286# DISABLE_SOCKET_FORWARDING = NO 286# DISABLE_SOCKET_FORWARDING = NO
287# DEBUG = YES 287# DEBUG = YES
288MAX_PENDING_REQUESTS = 65536 288MAX_PENDING_REQUESTS = 65536
289# Maximum frequency we're allowed to poll the datastore
290# for content for migration (can be used to reduce
291# GNUnet's disk-IO rate)
289MIN_MIGRATION_DELAY = 1000 292MIN_MIGRATION_DELAY = 1000
290EXPECTED_NEIGHBOUR_COUNT = 128 293EXPECTED_NEIGHBOUR_COUNT = 128
291 294
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index f24a11e82..e63c5d596 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -33,6 +33,8 @@
33 33
34#define CONNECT_ATTEMPTS 4 34#define CONNECT_ATTEMPTS 4
35 35
36#define CONTENT_LIFETIME GNUNET_TIME_UNIT_HOURS
37
36/** 38/**
37 * Handle for a daemon started for testing FS. 39 * Handle for a daemon started for testing FS.
38 */ 40 */
@@ -673,7 +675,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
673 do_index, 675 do_index,
674 anonymity, 676 anonymity,
675 42 /* priority */, 677 42 /* priority */,
676 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS)); 678 GNUNET_TIME_relative_to_absolute (CONTENT_LIFETIME));
677 } 679 }
678 else 680 else
679 { 681 {
@@ -687,7 +689,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon,
687 do_index, 689 do_index,
688 anonymity, 690 anonymity,
689 42 /* priority */, 691 42 /* priority */,
690 GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS)); 692 GNUNET_TIME_relative_to_absolute (CONTENT_LIFETIME));
691 } 693 }
692 daemon->publish_context = GNUNET_FS_publish_start (daemon->fs, 694 daemon->publish_context = GNUNET_FS_publish_start (daemon->fs,
693 fi, 695 fi,
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index c8271ed8e..deaa04289 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -92,6 +92,15 @@
92#define MAX_DHT_PUT_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 92#define MAX_DHT_PUT_FREQ GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
93 93
94/** 94/**
95 * How long must content remain valid for us to consider it for migration?
96 * If content will expire too soon, there is clearly no point in pushing
97 * it to other peers. This value gives the threshold for migration. Note
98 * that if this value is increased, the migration testcase may need to be
99 * adjusted as well (especially the CONTENT_LIFETIME in fs_test_lib.c).
100 */
101#define MIN_MIGRATION_CONTENT_LIFETIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30)
102
103/**
95 * Inverse of the probability that we will submit the same query 104 * Inverse of the probability that we will submit the same query
96 * to the same peer again. If the same peer already got the query 105 * to the same peer again. If the same peer already got the query
97 * repeatedly recently, the probability is multiplied by the inverse 106 * repeatedly recently, the probability is multiplied by the inverse
@@ -1283,6 +1292,13 @@ process_migration_content (void *cls,
1283 consider_migration_gathering (); 1292 consider_migration_gathering ();
1284 return; 1293 return;
1285 } 1294 }
1295 if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value <
1296 MIN_MIGRATION_CONTENT_LIFETIME.rel_value)
1297 {
1298 /* content will expire soon, don't bother */
1299 GNUNET_DATASTORE_get_next (dsh, GNUNET_YES);
1300 return;
1301 }
1286 if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND) 1302 if (type == GNUNET_BLOCK_TYPE_FS_ONDEMAND)
1287 { 1303 {
1288 if (GNUNET_OK != 1304 if (GNUNET_OK !=