diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-04 05:49:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-04 05:49:34 +0000 |
commit | 4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9 (patch) | |
tree | d325fb5bec27b83988af8d40b0616508d5e1fb58 /src/namestore/gnunet-namestore.c | |
parent | ff30e05925284ed431e50f366b2f0aaecabf8a91 (diff) | |
download | gnunet-4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9.tar.gz gnunet-4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9.zip |
-add logic to print expiration times for records
Diffstat (limited to 'src/namestore/gnunet-namestore.c')
-rw-r--r-- | src/namestore/gnunet-namestore.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 617604359..47018e2ec 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -326,6 +326,9 @@ display_record (void *cls, | |||
326 | const char *typestring; | 326 | const char *typestring; |
327 | char *s; | 327 | char *s; |
328 | unsigned int i; | 328 | unsigned int i; |
329 | const char *ets; | ||
330 | struct GNUNET_TIME_Absolute at; | ||
331 | struct GNUNET_TIME_Relative rt; | ||
329 | 332 | ||
330 | if (NULL == name) | 333 | if (NULL == name) |
331 | { | 334 | { |
@@ -352,10 +355,21 @@ display_record (void *cls, | |||
352 | (unsigned int) rd[i].record_type); | 355 | (unsigned int) rd[i].record_type); |
353 | continue; | 356 | continue; |
354 | } | 357 | } |
358 | if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) | ||
359 | { | ||
360 | rt.rel_value_us = rd[i].expiration_time; | ||
361 | ets = GNUNET_STRINGS_relative_time_to_string (rt, GNUNET_YES); | ||
362 | } | ||
363 | else | ||
364 | { | ||
365 | at.abs_value_us = rd[i].expiration_time; | ||
366 | ets = GNUNET_STRINGS_absolute_time_to_string (at); | ||
367 | } | ||
355 | FPRINTF (stdout, | 368 | FPRINTF (stdout, |
356 | "\t%s: %s\n", | 369 | "\t%s: %s (%s)\n", |
357 | typestring, | 370 | typestring, |
358 | s); | 371 | s, |
372 | ets); | ||
359 | GNUNET_free (s); | 373 | GNUNET_free (s); |
360 | } | 374 | } |
361 | FPRINTF (stdout, "%s", "\n"); | 375 | FPRINTF (stdout, "%s", "\n"); |