try {
total = broadcastAccFunction<uint64_t>(boost::bind(pleaseDumpNSSpeeds, fd));
}
- catch(...){}
+ catch(std::exception& e)
+ {
+ close(fd);
+ return "error dumping NS speeds: "+string(e.what())+"\n";
+ }
+ catch(PDNSException& e)
+ {
+ close(fd);
+ return "error dumping NS speeds: "+e.reason+"\n";
+ }
close(fd);
return "dumped "+std::to_string(total)+" records\n";
for(const auto& i : t_sstorage.nsSpeeds)
{
count++;
- fprintf(fp, "%s -> ", i.first.toString().c_str());
+
+ // an <empty> can appear hear in case of authoritative (hosted) zones
+ fprintf(fp, "%s -> ", i.first.toLogString().c_str());
for(const auto& j : i.second.d_collection)
{
// typedef vector<pair<ComboAddress, DecayingEwma> > collection_t;
if(ret.size() > 1) {
map<ComboAddress, double> speeds;
-
auto& collection = t_sstorage.nsSpeeds[qname].d_collection;
for(const auto& val: ret) {
double speed;
{
vector<DNSName> rnameservers;
rnameservers.reserve(tnameservers.size());
- for(const auto& tns:tnameservers) {
+ for(const auto& tns: tnameservers) {
rnameservers.push_back(tns.first);
+ if(tns.first.empty()) // this was an authoritative OOB zone, don't pollute the nsSpeeds with that
+ return rnameservers;
}
map<DNSName, double> speeds;