aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/gnunet-namestore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-29 22:12:43 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-29 22:12:43 +0000
commit54dca55c614ddacaacdef0e025e6c9429901b7a0 (patch)
tree3963c5ad420f9dbdbdd861f63b7a31b9658f823a /src/namestore/gnunet-namestore.c
parent2ff1dfc95ae595ed0d14bef76b58f33fa5e673f8 (diff)
downloadgnunet-54dca55c614ddacaacdef0e025e6c9429901b7a0.tar.gz
gnunet-54dca55c614ddacaacdef0e025e6c9429901b7a0.zip
-display expiration times with records
Diffstat (limited to 'src/namestore/gnunet-namestore.c')
-rw-r--r--src/namestore/gnunet-namestore.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 27978be03..9859688dd 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -236,6 +236,9 @@ display_record (void *cls,
236 const char *typestring; 236 const char *typestring;
237 char *s; 237 char *s;
238 unsigned int i; 238 unsigned int i;
239 char *etime;
240 struct GNUNET_TIME_Absolute aex;
241 struct GNUNET_TIME_Relative rex;
239 242
240 if (NULL == name) 243 if (NULL == name)
241 { 244 {
@@ -260,7 +263,22 @@ display_record (void *cls,
260 (unsigned int) rd[i].record_type); 263 (unsigned int) rd[i].record_type);
261 continue; 264 continue;
262 } 265 }
263 FPRINTF (stdout, "\t%s: %s\n", typestring, s); 266 if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION))
267 {
268 rex.rel_value = rd[i].expiration_time;
269 etime = GNUNET_STRINGS_relative_time_to_string (rex);
270 }
271 else
272 {
273 aex.abs_value = rd[i].expiration_time;
274 etime = GNUNET_STRINGS_absolute_time_to_string (aex);
275 }
276 FPRINTF (stdout, "\t%s: %s (%s %s)\n", typestring, s,
277 (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION))
278 ? _(/* what follows is relative expiration */ "for at least")
279 : _(/* what follows is absolute expiration */ "until"),
280 etime);
281 GNUNET_free (etime);
264 GNUNET_free (s); 282 GNUNET_free (s);
265 } 283 }
266 FPRINTF (stdout, "%s", "\n"); 284 FPRINTF (stdout, "%s", "\n");