gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit 4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9
parent ff30e05925284ed431e50f366b2f0aaecabf8a91
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  4 Oct 2013 05:49:34 +0000

-add logic to print expiration times for records

Diffstat:
Msrc/namestore/gnunet-namestore.c | 18++++++++++++++++--
Msrc/namestore/gnunet-service-namestore.c | 2+-
Msrc/namestore/test_namestore_lookup.sh | 1-
3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c @@ -326,6 +326,9 @@ display_record (void *cls, const char *typestring; char *s; unsigned int i; + const char *ets; + struct GNUNET_TIME_Absolute at; + struct GNUNET_TIME_Relative rt; if (NULL == name) { @@ -352,10 +355,21 @@ display_record (void *cls, (unsigned int) rd[i].record_type); continue; } + if (0 != (rd[i].flags & GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)) + { + rt.rel_value_us = rd[i].expiration_time; + ets = GNUNET_STRINGS_relative_time_to_string (rt, GNUNET_YES); + } + else + { + at.abs_value_us = rd[i].expiration_time; + ets = GNUNET_STRINGS_absolute_time_to_string (at); + } FPRINTF (stdout, - "\t%s: %s\n", + "\t%s: %s (%s)\n", typestring, - s); + s, + ets); GNUNET_free (s); } FPRINTF (stdout, "%s", "\n"); diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c @@ -443,7 +443,7 @@ handle_lookup_block (void *cls, * Handles a #GNUNET_MESSAGE_TYPE_NAMESTORE_BLOCK_CACHE message * * @param cls unused - * @param client GNUNET_SERVER_Client sending the message + * @param client client sending the message * @param message message of type 'struct BlockCacheMessage' */ static void diff --git a/src/namestore/test_namestore_lookup.sh b/src/namestore/test_namestore_lookup.sh @@ -3,7 +3,6 @@ CONFIGURATION="test_namestore_api.conf" trap "gnunet-arm -e -c $CONFIGURATION" SIGINT rm -rf `gnunet-config -c $CONFIGURATION -s PATHS -o SERVICEHOME` TEST_IP_PLUS="127.0.0.1" -TEST_RECORD_NAME_PLUS="www" TEST_RECORD_NAME_DNS="www3" which timeout &> /dev/null && DO_TIMEOUT="timeout 5"