don't load non-reachable routers

This commit is contained in:
orignal 2014-07-24 20:47:12 -04:00
parent d512c90193
commit 3961fdc2e1
2 changed files with 24 additions and 10 deletions

View file

@ -267,15 +267,25 @@ namespace data
for (boost::filesystem::directory_iterator it1 (it->path ()); it1 != end; ++it1)
{
#if BOOST_VERSION > 10500
RouterInfo * r = new RouterInfo (it1->path().string());
const std::string& fullPath = it1->path().string();
#else
RouterInfo * r = new RouterInfo(it1->path());
const std::string& fullPath = it1->path();
#endif
r->DeleteBuffer ();
m_RouterInfos[r->GetIdentHash ()] = r;
if (r->IsFloodfill ())
m_Floodfills.push_back (r);
numRouters++;
RouterInfo * r = new RouterInfo(fullPath);
if (!r->IsUnreachable ())
{
r->DeleteBuffer ();
m_RouterInfos[r->GetIdentHash ()] = r;
if (r->IsFloodfill ())
m_Floodfills.push_back (r);
numRouters++;
}
else
{
if (boost::filesystem::exists (fullPath))
boost::filesystem::remove (fullPath);
delete r;
}
}
}
}