--- unreal/src/res.c 2009/02/01 16:43:33 1.1.1.1.6.1.2.71.2.26 +++ unreal/src/res.c 2009/05/13 10:28:06 1.1.1.1.6.1.2.71.2.27 @@ -722,21 +722,34 @@ char *param; } else if (*param == 'i') /* INFORMATION */ { - struct ares_config_info inf; + struct ares_options inf; int i; + int optmask; - ares_get_config(&inf, resolver_channel); + ares_save_options(resolver_channel, &inf, &optmask); sendtxtnumeric(sptr, "****** DNS Configuration Information ******"); sendtxtnumeric(sptr, " c-ares version: %s",ares_version(NULL)); - sendtxtnumeric(sptr, " timeout: %d", inf.timeout); - sendtxtnumeric(sptr, " tries: %d", inf.tries); - sendtxtnumeric(sptr, " # of servers: %d", inf.numservers); - for (i = 0; i < inf.numservers; i++) - sendtxtnumeric(sptr, " server #%d: %s", i+1, inf.servers[i] ? inf.servers[i] : "[???]"); - - /* TODO: free or get memleak ! */ + + if(optmask & ARES_OPT_TIMEOUTMS) + sendtxtnumeric(sptr, " timeout: %d", inf.timeout); + if(optmask & ARES_OPT_TRIES) + sendtxtnumeric(sptr, " tries: %d", inf.tries); + if(optmask & ARES_OPT_SERVERS) + { + sendtxtnumeric(sptr, " # of servers: %d", inf.nservers); + for (i = 0; i < inf.nservers; i++) + sendtxtnumeric(sptr, " server #%d: %s", i+1, inet_ntoa(inf.servers[i])); + } + if(optmask & ARES_OPT_DOMAINS) + { + sendtxtnumeric(sptr, " # of search domains: %d", inf.ndomains); + for (i = 0; i < inf.ndomains; i++) + sendtxtnumeric(sptr, " domain #%d: %s", i+1, inf.domains[i]); + } sendtxtnumeric(sptr, "****** End of DNS Configuration Info ******"); + + ares_destroy_options(&inf); } else /* STATISTICS */ { sendtxtnumeric(sptr, "DNS CACHE Stats:");