From: Christian Grothoff Date: Wed, 25 Apr 2018 14:23:04 +0000 (+0200) Subject: more logging of exp time X-Git-Tag: v0.11.0pre66~93^2~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3c62493eb1aaa74812bbb79431686d99652417f4;p=oweals%2Fgnunet.git more logging of exp time --- diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index 2fffbeba7..f8ac6c31c 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -688,6 +688,7 @@ refresh_block (struct NamestoreClient *nc, struct GNUNET_GNSRECORD_Data *nick; struct GNUNET_GNSRECORD_Data *res; unsigned int res_count; + struct GNUNET_TIME_Absolute exp_time; nick = get_nick_record (zone_key); res_count = rd_count; @@ -702,26 +703,23 @@ refresh_block (struct NamestoreClient *nc, GNUNET_free (nick); } - if (0 == res_count) - block = GNUNET_GNSRECORD_block_create (zone_key, - GNUNET_TIME_UNIT_ZERO_ABS, - name, - res, - rd_count); - else - block = GNUNET_GNSRECORD_block_create (zone_key, - GNUNET_GNSRECORD_record_get_expiration_time (res_count, - res), - name, - res, - res_count); + exp_time = (0 == res_count) + ? GNUNET_TIME_UNIT_ZERO_ABS + : GNUNET_GNSRECORD_record_get_expiration_time (res_count, + res); + block = GNUNET_GNSRECORD_block_create (zone_key, + exp_time, + name, + res, + res_count); GNUNET_assert (NULL != block); GNUNET_CRYPTO_ecdsa_key_get_public (zone_key, &pkey); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Caching block for label `%s' with %u records in zone `%s' in namecache\n", + "Caching block for label `%s' with %u records and expiration %s in zone `%s' in namecache\n", name, res_count, + GNUNET_STRINGS_absolute_time_to_string (exp_time), GNUNET_GNSRECORD_z2s (&pkey)); GNUNET_STATISTICS_update (statistics, "Namecache updates pushed", diff --git a/src/namestore/gnunet-zoneimport.c b/src/namestore/gnunet-zoneimport.c index c26d33bad..faef436ac 100644 --- a/src/namestore/gnunet-zoneimport.c +++ b/src/namestore/gnunet-zoneimport.c @@ -676,6 +676,10 @@ process_record (void *cls, req->hostname); return; /* record expired */ } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "DNS returned record that expires at %s for `%s'\n", + GNUNET_STRINGS_absolute_time_to_string (rec->expiration_time), + req->hostname); switch (rec->type) { case GNUNET_DNSPARSER_TYPE_NS: