aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-11-12 20:48:43 +0100
committerChristian Grothoff <christian@grothoff.org>2018-11-12 20:48:43 +0100
commitb26dc73654be36d70f1b3c06e23fec42330db4f6 (patch)
tree72d18ba84265396b1046f5058849f79ddd060289
parent748788145250b3a012b0d3164461363d9add79a8 (diff)
downloadgnunet-b26dc73654be36d70f1b3c06e23fec42330db4f6.tar.gz
gnunet-b26dc73654be36d70f1b3c06e23fec42330db4f6.zip
fix etime setting in gnunet-namestore
-rw-r--r--src/namestore/gnunet-namestore.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 865481746..619d0c528 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -191,14 +191,10 @@ static void *data;
191static size_t data_size; 191static size_t data_size;
192 192
193/** 193/**
194 * Expirationstring converted to relative time. 194 * Expiration string converted to numeric value.
195 */ 195 */
196static struct GNUNET_TIME_Relative etime_rel; 196static uint64_t etime;
197 197
198/**
199 * Expirationstring converted to absolute time.
200 */
201static struct GNUNET_TIME_Absolute etime_abs;
202 198
203/** 199/**
204 * Is expiration time relative or absolute time? 200 * Is expiration time relative or absolute time?
@@ -539,6 +535,8 @@ display_record_lookup (void *cls,
539 unsigned int rd_len, 535 unsigned int rd_len,
540 const struct GNUNET_GNSRECORD_Data *rd) 536 const struct GNUNET_GNSRECORD_Data *rd)
541{ 537{
538 (void) cls;
539 (void) zone_key;
542 get_qe = NULL; 540 get_qe = NULL;
543 display_record (rname, 541 display_record (rname,
544 rd_len, 542 rd_len,
@@ -717,14 +715,10 @@ get_existing_record (void *cls,
717 rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; 715 rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;
718 if (1 != is_public) 716 if (1 != is_public)
719 rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; 717 rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE;
718 rde->expiration_time = etime;
720 if (GNUNET_YES == etime_is_rel) 719 if (GNUNET_YES == etime_is_rel)
721 {
722 rde->expiration_time = etime_rel.rel_value_us;
723 rde->flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; 720 rde->flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
724 } 721 else if (GNUNET_NO != etime_is_rel)
725 else if (GNUNET_NO == etime_is_rel)
726 rde->expiration_time = etime_abs.abs_value_us;
727 else
728 rde->expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; 722 rde->expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us;
729 GNUNET_assert (NULL != name); 723 GNUNET_assert (NULL != name);
730 add_qe = GNUNET_NAMESTORE_records_store (ns, 724 add_qe = GNUNET_NAMESTORE_records_store (ns,
@@ -988,7 +982,6 @@ identity_cb (void *cls,
988 const struct GNUNET_CONFIGURATION_Handle *cfg = cls; 982 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
989 struct GNUNET_CRYPTO_EcdsaPublicKey pub; 983 struct GNUNET_CRYPTO_EcdsaPublicKey pub;
990 struct GNUNET_GNSRECORD_Data rd; 984 struct GNUNET_GNSRECORD_Data rd;
991 uint64_t etime;
992 985
993 el = NULL; 986 el = NULL;
994 if (NULL == ego) 987 if (NULL == ego)
@@ -1359,6 +1352,8 @@ multirecord_process (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
1359 int etime_is_rel; 1352 int etime_is_rel;
1360 void *raw_data; 1353 void *raw_data;
1361 1354
1355 (void) ctx;
1356 (void) option;
1362 cp = GNUNET_strdup (value); 1357 cp = GNUNET_strdup (value);
1363 tok = strtok (cp, " "); 1358 tok = strtok (cp, " ");
1364 if (NULL == tok) 1359 if (NULL == tok)