From b8be5b115dac6c4b93045a01dcbc2fac57209cbc Mon Sep 17 00:00:00 2001 From: Martin Nagy Date: Tue, 8 Dec 2009 19:26:50 +0100 Subject: Add some debugging statements to fail_over and resolver These were very useful for debugging and hopefully still will be in the future. --- server/resolv/async_resolv.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'server/resolv') diff --git a/server/resolv/async_resolv.c b/server/resolv/async_resolv.c index f778d1f4..14e9f0c8 100644 --- a/server/resolv/async_resolv.c +++ b/server/resolv/async_resolv.c @@ -160,7 +160,7 @@ fd_event_add(struct resolv_ctx *ctx, int s) /* The file descriptor is new, register it with tevent. */ watch = talloc(ctx, struct fd_watch); if (watch == NULL) { - DEBUG(1, ("Out of memory allocating fd_watch structure")); + DEBUG(1, ("Out of memory allocating fd_watch structure\n")); return; } talloc_set_destructor(watch, fd_watch_destructor); @@ -170,7 +170,7 @@ fd_event_add(struct resolv_ctx *ctx, int s) fde = tevent_add_fd(ctx->ev_ctx, watch, s, TEVENT_FD_READ, fd_input_available, watch); if (fde == NULL) { - DEBUG(1, ("tevent_add_fd() failed")); + DEBUG(1, ("tevent_add_fd() failed\n")); talloc_free(watch); return; } @@ -240,7 +240,7 @@ resolv_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx, options.sock_state_cb_data = ctx; ret = ares_init_options(&ctx->channel, &options, ARES_OPT_SOCK_STATE_CB); if (ret != ARES_SUCCESS) { - DEBUG(1, ("Failed to initialize ares channel: %s", + DEBUG(1, ("Failed to initialize ares channel: %s\n", resolv_strerror(ret))); ret = return_code(ret); goto done; @@ -341,6 +341,8 @@ resolv_gethostbyname_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct gethostbyname_state *state; struct timeval tv = { 0, 0 }; + DEBUG(4, ("Trying to resolve A record of '%s'\n", name)); + if (ctx->channel == NULL) { DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); return NULL; @@ -532,6 +534,8 @@ resolv_getsrv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct getsrv_state *state; struct timeval tv = { 0, 0 }; + DEBUG(4, ("Trying to resolve SRV record of '%s'\n", query)); + if (ctx->channel == NULL) { DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); return NULL; @@ -721,6 +725,8 @@ resolv_gettxt_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct gettxt_state *state; struct timeval tv = { 0, 0 }; + DEBUG(4, ("Trying to resolve TXT record of '%s'\n", query)); + if (ctx->channel == NULL) { DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); return NULL; -- cgit