[PATCH 5/6] site: Log when resolution completes

Ian Jackson ijackson at chiark.greenend.org.uk
Sat May 17 19:46:34 BST 2014

This helps with debugging dns and reentrancy problems.

Also, assert in ensure_resolving that we have an address.  This makes
it slightly clearer that callers are expected to have checked this.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>

New patch in v2 of the series.
 site.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/site.c b/site.c
index b04f3b3..0e2c43a 100644
--- a/site.c
+++ b/site.c
@@ -1161,6 +1161,8 @@ static void site_resolve_callback(void *sst, struct in_addr *address)
+	slog(st,LOG_STATE,"resolution of %s completed: %s",
+	     st->address, comm_addr_to_string(ca_use));;
     } else {
 	slog(st,LOG_ERROR,"resolution of %s failed",st->address);
@@ -1295,6 +1297,8 @@ static bool_t ensure_resolving(struct site *st)
     if (st->resolving)
         return True;
+    assert(st->address);
     /* resolver->request might reentrantly call site_resolve_callback
      * which will clear st->resolving, so we need to set it beforehand
      * rather than afterwards; also, it might return False, in which

More information about the sgo-software-discuss mailing list