aboutsummaryrefslogtreecommitdiff
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
parent2bee6f88f4754bc9317ff12334220e2bc6cfe5a2 (diff)
downloadgnunet-2c589fcdf9eb24144786b8800cbba1c99a9452e8.tar.gz
gnunet-2c589fcdf9eb24144786b8800cbba1c99a9452e8.zip
FCFSD: Allow configuration of relative expiration time of added records
m---------contrib/gana0
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c20
-rw-r--r--src/namestore/namestore.conf.in1
3 files changed, 19 insertions, 2 deletions
diff --git a/contrib/gana b/contrib/gana
Subproject 0958add542378a6ca9c411e2dc19527834e9f64 Subproject f2babbbdd477eeafb17292e16f335226ea02cb6
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;
165static struct StaticPage *forbidden_page = NULL; 165static struct StaticPage *forbidden_page = NULL;
166 166
167/** 167/**
168 * The relative expiration time for added records
169 */
170static struct GNUNET_TIME_Relative record_exp;
171
172/**
168 * Task ran at shutdown to clean up everything. 173 * Task ran at shutdown to clean up everything.
169 * 174 *
170 * @param cls unused 175 * @param cls unused
@@ -532,8 +537,8 @@ register_do_cb (void *cls,
532 } 537 }
533 538
534 gd.data = gdraw; 539 gd.data = gdraw;
535 gd.expiration_time = UINT64_MAX; 540 gd.expiration_time = record_exp.rel_value_us;
536 gd.flags = GNUNET_GNSRECORD_RF_NONE; 541 gd.flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
537 542
538 rd->searching = GNUNET_NAMESTORE_records_store (namestore, 543 rd->searching = GNUNET_NAMESTORE_records_store (namestore,
539 zone_key, 544 zone_key,
@@ -1062,6 +1067,17 @@ run_service (void *cls,
1062 1067
1063 GNUNET_log_setup ("fcfsd", "WARNING", NULL); 1068 GNUNET_log_setup ("fcfsd", "WARNING", NULL);
1064 1069
1070 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg,
1071 "fcfsd",
1072 "RELATIVE_RECORD_EXPIRATION",
1073 &record_exp))
1074 {
1075 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1076 _("No expiration specified for records.\n"));
1077 GNUNET_SCHEDULER_shutdown ();
1078 return;
1079 }
1080
1065 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, 1081 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg,
1066 "fcfsd", 1082 "fcfsd",
1067 "HTTPPORT", 1083 "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
44BINARY = gnunet-namestore-fcfsd 44BINARY = gnunet-namestore-fcfsd
45START_ON_DEMAND = NO 45START_ON_DEMAND = NO
46UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-fcfsd.sock 46UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-fcfsd.sock
47RELATIVE_RECORD_EXPIRATION = 7 d
47 48
48# On what port does the FCFS daemon listen for HTTP clients? 49# On what port does the FCFS daemon listen for HTTP clients?
49HTTPPORT = 18080 50HTTPPORT = 18080