[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13830 - in gnunet: contrib src/fs
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13830 - in gnunet: contrib src/fs |
Date: |
Tue, 30 Nov 2010 12:23:46 +0100 |
Author: grothoff
Date: 2010-11-30 12:23:46 +0100 (Tue, 30 Nov 2010)
New Revision: 13830
Modified:
gnunet/contrib/defaults.conf
gnunet/src/fs/gnunet-service-fs.c
Log:
bi-di migration options
Modified: gnunet/contrib/defaults.conf
===================================================================
--- gnunet/contrib/defaults.conf 2010-11-30 11:23:36 UTC (rev 13829)
+++ gnunet/contrib/defaults.conf 2010-11-30 11:23:46 UTC (rev 13830)
@@ -278,9 +278,8 @@
ACCEPT_FROM = 127.0.0.1;
ACCEPT_FROM6 = ::1;
-ACTIVEMIGRATION = YES
-# NEW: CONTENT_CACHING = YES
-# NEW: CONTENT_PUSHING = YES
+CONTENT_CACHING = YES
+CONTENT_PUSHING = YES
UNIXPATH = /tmp/gnunet-service-fs.sock
# DISABLE_SOCKET_FORWARDING = NO
Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c 2010-11-30 11:23:36 UTC (rev 13829)
+++ gnunet/src/fs/gnunet-service-fs.c 2010-11-30 11:23:46 UTC (rev 13830)
@@ -885,9 +885,14 @@
/**
* Are we allowed to migrate content to this peer.
*/
-static int active_migration;
+static int active_to_migration;
/**
+ * Are we allowed to push out content from this peer.
+ */
+static int active_from_migration;
+
+/**
* How many entires with zero anonymity do we currently estimate
* to have in the database?
*/
@@ -3618,7 +3623,7 @@
prq.sender->inc_preference += CONTENT_BANDWIDTH_VALUE + 1000 *
prq.priority;
change_host_trust (prq.sender, prq.priority);
}
- if ( (GNUNET_YES == active_migration) &&
+ if ( (GNUNET_YES == active_to_migration) &&
(GNUNET_NO == test_put_load_too_high (prq.priority)) )
{
#if DEBUG_FS
@@ -3640,7 +3645,7 @@
}
putl = GNUNET_LOAD_get_load (datastore_put_load);
if ( (GNUNET_NO == prq.request_found) &&
- ( (GNUNET_YES != active_migration) ||
+ ( (GNUNET_YES != active_to_migration) ||
(putl > 2.5 * (1 + prq.priority)) ) )
{
cp = GNUNET_CONTAINER_multihashmap_get (connected_peers,
@@ -3648,7 +3653,7 @@
if (GNUNET_TIME_absolute_get_duration
(cp->last_migration_block).rel_value < 5000)
return GNUNET_OK; /* already blocked */
/* We're too busy; send MigrationStop message! */
- if (GNUNET_YES != active_migration)
+ if (GNUNET_YES != active_to_migration)
putl = 1.0 + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 5);
block_time = GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MILLISECONDS,
5000 +
GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -4587,8 +4592,7 @@
}
return GNUNET_SYSERR;
}
- /* FIXME: distinguish between sending and storing in options? */
- if (active_migration)
+ if (active_from_migration)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Content migration is enabled, will start to gather
data\n"));
@@ -4628,9 +4632,12 @@
struct GNUNET_SERVER_Handle *server,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- active_migration = GNUNET_CONFIGURATION_get_value_yesno (cfg,
- "FS",
- "ACTIVEMIGRATION");
+ active_to_migration = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "FS",
+
"CONTENT_CACHING");
+ active_from_migration = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "FS",
+
"CONTENT_PUSHING");
dsh = GNUNET_DATASTORE_connect (cfg);
if (dsh == NULL)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13830 - in gnunet: contrib src/fs,
gnunet <=