From: Christian Grothoff Date: Fri, 29 Jun 2012 22:12:43 +0000 (+0000) Subject: -display expiration times with records X-Git-Tag: initial-import-from-subversion-38251~12716 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=54dca55c614ddacaacdef0e025e6c9429901b7a0;p=oweals%2Fgnunet.git -display expiration times with records --- 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, const char *typestring; char *s; unsigned int i; + char *etime; + struct GNUNET_TIME_Absolute aex; + struct GNUNET_TIME_Relative rex; if (NULL == name) { @@ -260,7 +263,22 @@ display_record (void *cls, (unsigned int) rd[i].record_type); continue; } - FPRINTF (stdout, "\t%s: %s\n", typestring, s); + if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) + { + rex.rel_value = rd[i].expiration_time; + etime = GNUNET_STRINGS_relative_time_to_string (rex); + } + else + { + aex.abs_value = rd[i].expiration_time; + etime = GNUNET_STRINGS_absolute_time_to_string (aex); + } + FPRINTF (stdout, "\t%s: %s (%s %s)\n", typestring, s, + (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) + ? _(/* what follows is relative expiration */ "for at least") + : _(/* what follows is absolute expiration */ "until"), + etime); + GNUNET_free (etime); GNUNET_free (s); } FPRINTF (stdout, "%s", "\n");