|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
#include <crypto/crypto.hpp>
|
|
|
|
|
#include <util/fs.hpp>
|
|
|
|
|
#include <utility>
|
|
|
|
|
#include <unordered_set>
|
|
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
|
{
|
|
|
|
@ -125,6 +126,7 @@ namespace llarp
|
|
|
|
|
void
|
|
|
|
|
ILinkLayer::Pump()
|
|
|
|
|
{
|
|
|
|
|
std::unordered_set< RouterID, RouterID::Hash > closedSessions;
|
|
|
|
|
auto _now = Now();
|
|
|
|
|
{
|
|
|
|
|
ACQUIRE_LOCK(Lock_t l, m_AuthedLinksMutex);
|
|
|
|
@ -141,6 +143,7 @@ namespace llarp
|
|
|
|
|
llarp::LogInfo("session to ", RouterID(itr->second->GetPubKey()),
|
|
|
|
|
" timed out");
|
|
|
|
|
itr->second->Close();
|
|
|
|
|
closedSessions.emplace(itr->first);
|
|
|
|
|
itr = m_AuthedLinks.erase(itr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -169,6 +172,16 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
ACQUIRE_LOCK(Lock_t l, m_AuthedLinksMutex);
|
|
|
|
|
for(const auto& r : closedSessions)
|
|
|
|
|
{
|
|
|
|
|
if(m_AuthedLinks.count(r) == 0)
|
|
|
|
|
{
|
|
|
|
|
SessionClosed(r);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|