aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-04 05:49:34 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-04 05:49:34 +0000
commit4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9 (patch)
treed325fb5bec27b83988af8d40b0616508d5e1fb58 /src/namestore
parentff30e05925284ed431e50f366b2f0aaecabf8a91 (diff)
downloadgnunet-4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9.tar.gz
gnunet-4c297e9d83087fef43bb3c6cb89b8787b5d7bdc9.zip
-add logic to print expiration times for records
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore.c18
-rw-r--r--src/namestore/gnunet-service-namestore.c2
-rwxr-xr-xsrc/namestore/test_namestore_lookup.sh1
3 files changed, 17 insertions, 4 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");
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index b39d3858c..7ca043d8a 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -443,7 +443,7 @@ handle_lookup_block (void *cls,
443 * Handles a #GNUNET_MESSAGE_TYPE_NAMESTORE_BLOCK_CACHE message 443 * Handles a #GNUNET_MESSAGE_TYPE_NAMESTORE_BLOCK_CACHE message
444 * 444 *
445 * @param cls unused 445 * @param cls unused
446 * @param client GNUNET_SERVER_Client sending the message 446 * @param client client sending the message
447 * @param message message of type 'struct BlockCacheMessage' 447 * @param message message of type 'struct BlockCacheMessage'
448 */ 448 */
449static void 449static void
diff --git a/src/namestore/test_namestore_lookup.sh b/src/namestore/test_namestore_lookup.sh
index 99757b102..681af7d96 100755
--- a/src/namestore/test_namestore_lookup.sh
+++ b/src/namestore/test_namestore_lookup.sh
@@ -3,7 +3,6 @@ CONFIGURATION="test_namestore_api.conf"
3trap "gnunet-arm -e -c $CONFIGURATION" SIGINT 3trap "gnunet-arm -e -c $CONFIGURATION" SIGINT
4rm -rf `gnunet-config -c $CONFIGURATION -s PATHS -o SERVICEHOME` 4rm -rf `gnunet-config -c $CONFIGURATION -s PATHS -o SERVICEHOME`
5TEST_IP_PLUS="127.0.0.1" 5TEST_IP_PLUS="127.0.0.1"
6TEST_RECORD_NAME_PLUS="www"
7TEST_RECORD_NAME_DNS="www3" 6TEST_RECORD_NAME_DNS="www3"
8which timeout &> /dev/null && DO_TIMEOUT="timeout 5" 7which timeout &> /dev/null && DO_TIMEOUT="timeout 5"
9 8