X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fc-ares-dns%2Fserv_c-ares-dns.c;h=5f8426f9894731910675c94ff78c99ce3ddd537c;hb=2b1af802b6361c71b7d2376cc8b5812918beb47f;hp=6c1be1f167a9ed3bb701a5c0b2fac9c98579352c;hpb=c12b418a64b44be9d08cae0e5dd25c988a522b90;p=citadel.git diff --git a/citadel/modules/c-ares-dns/serv_c-ares-dns.c b/citadel/modules/c-ares-dns/serv_c-ares-dns.c index 6c1be1f16..5f8426f98 100644 --- a/citadel/modules/c-ares-dns/serv_c-ares-dns.c +++ b/citadel/modules/c-ares-dns/serv_c-ares-dns.c @@ -223,19 +223,23 @@ void QueryCb(void *arg, IO->PostDNS(IO); } -int QueueQuery(ns_type Type, char *name, AsyncIO *IO, IO_CallBack PostDNS) + +void InitC_ares_dns(AsyncIO *IO) { - int length, family; - char address_b[sizeof(struct in6_addr)]; int optmask = 0; - if (IO->DNSChannel == NULL) { optmask |= ARES_OPT_SOCK_STATE_CB; IO->DNSOptions.sock_state_cb = SockStateCb; IO->DNSOptions.sock_state_cb_data = IO; ares_init_options(&IO->DNSChannel, &IO->DNSOptions, optmask); } +} +int QueueQuery(ns_type Type, char *name, AsyncIO *IO, IO_CallBack PostDNS) +{ + int length, family; + char address_b[sizeof(struct in6_addr)]; + InitC_ares_dns(IO); IO->PostDNS = PostDNS; switch(Type) { case ns_t_a: