- bool cached;
- ServernameResolver* snr = new ServernameResolver(mine, Utils, ServerInstance, host, MyLink, cached, DNS_QUERY_A);
- ServerInstance->AddResolver(snr, cached);
- return;
+ Link* L = *i;
+ if (L->IPAddr == host)
+ {
+ for (std::vector<DNS::ResourceRecord>::const_iterator j = r->answers.begin(); j != r->answers.end(); ++j)
+ {
+ const DNS::ResourceRecord& ans_record = *j;
+ if (ans_record.type == this->question.type)
+ Utils->ValidIPs.push_back(ans_record.rdata);
+ }
+ break;
+ }
+ }
+}
+
+void SecurityIPResolver::OnError(const DNS::Query *r)
+{
+ // This can be called because of us being unloaded but we don't have to do anything differently
+ if (query == DNS::QUERY_AAAA)
+ {
+ SecurityIPResolver* res = new SecurityIPResolver(mine, this->manager, host, MyLink, DNS::QUERY_A);
+ try
+ {
+ this->manager->Process(res);
+ return;
+ }
+ catch (DNS::Exception &)
+ {
+ delete res;
+ }