std::cerr << "NameServer::resolv_recursive -> gotcha! "
<< rpr << "\n";
#endif
- // TODO agregar a cache
break;
}
return rpr; // Devuelvo el A o NOTFOUND
std::cerr << "NameServer::resolv_recursive_r -> gotcha! "
<< r << "\n";
#endif
- // TODO agregar a cache
return r; // Gotcha!
}
}
std::cerr << "NameServer::query -> recibido " << resp << " de "
<< ip << "\n";
#endif
+ // Agrego a cache
+ if (resp.ret == RP_RES_A)
+ cache[n] = CacheRecord(time(NULL) + resp.ttl, resp.ips);
return resp;
}