From ee2e45cde5db1aa4e8e2a53cc29666c16f8e48f4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 3 Sep 2012 13:25:23 +0000 Subject: [PATCH] better log message, fixing stale task --- src/gns/gnunet-dns2gns.c | 12 ++++++------ src/gns/gnunet-service-gns_resolver.c | 9 +++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index a61f4408a..25ff76985 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c @@ -353,12 +353,12 @@ handle_request (struct GNUNET_NETWORK_Handle *lsock, GNUNET_a2s (addr, addr_len)); return; } - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "%d, %d, %d, %d\n", - packet->flags.query_or_response, - packet->num_answers, - packet->num_authority_records, - packet->num_additional_records); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Received request with flags %u, #answers %d, #auth %d, #additional %d\n", + (unsigned int) packet->flags.query_or_response, + (int) packet->num_answers, + (int) packet->num_authority_records, + (int) packet->num_additional_records); if ( (0 != packet->flags.query_or_response) || (0 != packet->num_answers) || (0 != packet->num_authority_records)) diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 6a07f6d94..cea423fc7 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -920,15 +920,18 @@ on_namestore_record_put_result (void *cls, "GNS_NS: Error putting records into namestore: %s\n", emsg); } + static void handle_lookup_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct ResolverHandle *rh = cls; - if (rh->timeout_cont) + if (NULL != rh->timeout_cont) rh->timeout_cont (rh->timeout_cont_cls, tc); + /* FIXME: does this leak memory? */ } + /** * Processor for background lookups in the DHT * @@ -3473,8 +3476,10 @@ gns_resolver_lookup_record (struct GNUNET_CRYPTO_ShortHashCode zone, &rh->authority)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Cannot convert ZKEY %s to hash!\n", string_hash); + "Cannot convert ZKEY `%s' to hash!\n", string_hash); + if (GNUNET_SCHEDULER_NO_TASK != rh->timeout_task) + GNUNET_SCHEDULER_cancel (rh->timeout_task); GNUNET_CONTAINER_DLL_remove (rlh_head, rlh_tail, rh); GNUNET_free (rh); GNUNET_free (rlh); -- 2.25.1