diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-07-29 23:52:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-07-29 23:53:08 +0200 |
commit | a2a416f768e2aa7db5b975cd50eb19237cac9cce (patch) | |
tree | 9cb435068a007b47f88948136866200d8b963569 /src/resolve/resolved-dns-query.c | |
parent | bf3f1271e2cc0c22b11c8a805a997578dabe9191 (diff) |
resolved: add more debug logging
Diffstat (limited to 'src/resolve/resolved-dns-query.c')
-rw-r--r-- | src/resolve/resolved-dns-query.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index ecffe06959..f3007aa19c 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -19,6 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "af-list.h" + #include "resolved-dns-query.h" #include "resolved-dns-domain.h" @@ -132,6 +134,12 @@ void dns_query_transaction_complete(DnsQueryTransaction *t, DnsQueryState state) * should hence not attempt to access the query or transaction * after calling this function. */ + log_debug("Transaction on scope %s on %s/%s now complete with %s", + dns_protocol_to_string(t->scope->protocol), + t->scope->link ? t->scope->link->name : "*", + t->scope->family == AF_UNSPEC ? "*" : af_to_name(t->scope->family), + dns_query_state_to_string(state)); + t->state = state; dns_query_transaction_stop(t); @@ -419,6 +427,11 @@ static int dns_query_transaction_go(DnsQueryTransaction *t) { dns_query_transaction_stop(t); + log_debug("Beginning transaction on scope %s on %s/%s", + dns_protocol_to_string(t->scope->protocol), + t->scope->link ? t->scope->link->name : "*", + t->scope->family == AF_UNSPEC ? "*" : af_to_name(t->scope->family)); + if (t->n_attempts >= ATTEMPTS_MAX) { dns_query_transaction_complete(t, DNS_QUERY_ATTEMPTS_MAX); return 0; @@ -889,3 +902,17 @@ int dns_query_cname_redirect(DnsQuery *q, const char *name) { return 0; } + +static const char* const dns_query_state_table[_DNS_QUERY_STATE_MAX] = { + [DNS_QUERY_NULL] = "null", + [DNS_QUERY_PENDING] = "pending", + [DNS_QUERY_FAILURE] = "failure", + [DNS_QUERY_SUCCESS] = "success", + [DNS_QUERY_NO_SERVERS] = "no-servers", + [DNS_QUERY_TIMEOUT] = "timeout", + [DNS_QUERY_ATTEMPTS_MAX] = "attempts-max", + [DNS_QUERY_INVALID_REPLY] = "invalid-reply", + [DNS_QUERY_RESOURCES] = "resources", + [DNS_QUERY_ABORTED] = "aborted", +}; +DEFINE_STRING_TABLE_LOOKUP(dns_query_state, DnsQueryState); |