summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-05-09 09:00:52 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2022-05-09 09:00:52 +0200
commit2c589fcdf9eb24144786b8800cbba1c99a9452e8 (patch)
tree24e9860956a13a2ac63b39cbe76b5d1dd83c3b76 /src
parent2bee6f88f4754bc9317ff12334220e2bc6cfe5a2 (diff)
FCFSD: Allow configuration of relative expiration time of added records
Diffstat (limited to 'src')
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c20
-rw-r--r--src/namestore/namestore.conf.in1
2 files changed, 19 insertions, 2 deletions
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 5b13e50ff..7e96ffa43 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -165,6 +165,11 @@ static struct StaticPage *notfound_page = NULL;
static struct StaticPage *forbidden_page = NULL;
/**
+ * The relative expiration time for added records
+ */
+static struct GNUNET_TIME_Relative record_exp;
+
+/**
* Task ran at shutdown to clean up everything.
*
* @param cls unused
@@ -532,8 +537,8 @@ register_do_cb (void *cls,
}
gd.data = gdraw;
- gd.expiration_time = UINT64_MAX;
- gd.flags = GNUNET_GNSRECORD_RF_NONE;
+ gd.expiration_time = record_exp.rel_value_us;
+ gd.flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
rd->searching = GNUNET_NAMESTORE_records_store (namestore,
zone_key,
@@ -1062,6 +1067,17 @@ run_service (void *cls,
GNUNET_log_setup ("fcfsd", "WARNING", NULL);
+ if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg,
+ "fcfsd",
+ "RELATIVE_RECORD_EXPIRATION",
+ &record_exp))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("No expiration specified for records.\n"));
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
+
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg,
"fcfsd",
"HTTPPORT",
diff --git a/src/namestore/namestore.conf.in b/src/namestore/namestore.conf.in
index 733e4e2f8..a9c928c66 100644
--- a/src/namestore/namestore.conf.in
+++ b/src/namestore/namestore.conf.in
@@ -44,6 +44,7 @@ gns = gnunet-namestore -e 1a -u
BINARY = gnunet-namestore-fcfsd
START_ON_DEMAND = NO
UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-fcfsd.sock
+RELATIVE_RECORD_EXPIRATION = 7 d
# On what port does the FCFS daemon listen for HTTP clients?
HTTPPORT = 18080