int index;
GList *nameserver_list;
+ struct __res_state res;
+
GResolvDebugFunc debug_func;
gpointer debug_data;
};
resolv->index = index;
resolv->nameserver_list = NULL;
+ res_ninit(&resolv->res);
+
return resolv;
}
flush_nameservers(resolv);
+ res_nclose(&resolv->res);
+
g_free(resolv);
}
if (resolv == NULL)
return 0;
+ if (resolv->nameserver_list == NULL) {
+ int i;
+
+ for (i = 0; i < resolv->res.nscount; i++) {
+ struct sockaddr_in *addr = &resolv->res.nsaddr_list[i];
+ g_resolv_add_nameserver(resolv,
+ inet_ntoa(addr->sin_addr), 53, 0);
+ }
+
+ if (resolv->nameserver_list == NULL)
+ g_resolv_add_nameserver(resolv, "127.0.0.1", 53, 0);
+ }
+
query = g_try_new0(struct resolv_query, 1);
if (query == NULL)
return 0;