aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-17 14:14:33 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-17 14:14:33 +0000
commit480dc321e78214299ed9eb6718e833752a90082c (patch)
treeffbca4fd7dc5684af4409e5e1c406db7c52ff39c /src/fs/gnunet-service-fs.c
parent71be1744ba1e2396d97af436d45b397ad9ba333b (diff)
downloadgnunet-480dc321e78214299ed9eb6718e833752a90082c.tar.gz
gnunet-480dc321e78214299ed9eb6718e833752a90082c.zip
adding lifetime limits on migration content
Diffstat (limited to 'src/fs/gnunet-service-fs.c')
-rw-r--r--src/fs/gnunet-service-fs.c16
1 files changed, 16 insertions, 0 deletions
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 !=