|
|
@ -947,6 +947,18 @@ namespace llarp
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
Endpoint::MarkAddressOutbound(const Address& addr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_state->m_OutboundSessions.insert(addr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
|
|
|
Endpoint::WantsOutboundSession(const Address& addr) const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return m_state->m_OutboundSessions.count(addr) > 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Endpoint::EnsurePathToService(const Address remote, PathEnsureHook hook,
|
|
|
|
Endpoint::EnsurePathToService(const Address remote, PathEnsureHook hook,
|
|
|
|
ABSL_ATTRIBUTE_UNUSED llarp_time_t timeoutMS)
|
|
|
|
ABSL_ATTRIBUTE_UNUSED llarp_time_t timeoutMS)
|
|
|
@ -954,6 +966,8 @@ namespace llarp
|
|
|
|
static constexpr size_t NumParalellLookups = 2;
|
|
|
|
static constexpr size_t NumParalellLookups = 2;
|
|
|
|
LogInfo(Name(), " Ensure Path to ", remote.ToString());
|
|
|
|
LogInfo(Name(), " Ensure Path to ", remote.ToString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MarkAddressOutbound(remote);
|
|
|
|
|
|
|
|
|
|
|
|
auto& sessions = m_state->m_RemoteSessions;
|
|
|
|
auto& sessions = m_state->m_RemoteSessions;
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1193,8 +1207,7 @@ namespace llarp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
// outbound converstation
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto& sessions = m_state->m_RemoteSessions;
|
|
|
|
auto& sessions = m_state->m_RemoteSessions;
|
|
|
|
auto range = sessions.equal_range(remote);
|
|
|
|
auto range = sessions.equal_range(remote);
|
|
|
@ -1208,8 +1221,8 @@ namespace llarp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
++itr;
|
|
|
|
++itr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if there is an outbound context
|
|
|
|
// if we want to make an outbound session
|
|
|
|
if(range.first != sessions.end())
|
|
|
|
if(WantsOutboundSession(remote))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// add pending traffic
|
|
|
|
// add pending traffic
|
|
|
|
auto& traffic = m_state->m_PendingTraffic;
|
|
|
|
auto& traffic = m_state->m_PendingTraffic;
|
|
|
|