|
|
|
@ -348,26 +348,14 @@ namespace llarp
|
|
|
|
|
|
|
|
|
|
if (ReadyToSend() and m_ReadyHook)
|
|
|
|
|
{
|
|
|
|
|
KeepAlive();
|
|
|
|
|
const auto path = GetPathByRouter(remoteIntro.router);
|
|
|
|
|
if (not path)
|
|
|
|
|
{
|
|
|
|
|
LogWarn(Name(), " ready but no path to ", remoteIntro.router, " ???");
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
const auto rtt = (path->intro.latency + remoteIntro.latency) * 2;
|
|
|
|
|
m_router->loop()->call_later(
|
|
|
|
|
rtt, [rtt, self = shared_from_this(), hook = std::move(m_ReadyHook)]() {
|
|
|
|
|
LogInfo(
|
|
|
|
|
self->Name(),
|
|
|
|
|
" is ready, RTT is measured as ",
|
|
|
|
|
self->estimatedRTT,
|
|
|
|
|
" approximated as ",
|
|
|
|
|
rtt,
|
|
|
|
|
" delta=",
|
|
|
|
|
rtt - self->estimatedRTT);
|
|
|
|
|
hook(self.get());
|
|
|
|
|
});
|
|
|
|
|
m_ReadyHook(this);
|
|
|
|
|
m_ReadyHook = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (lastGoodSend > 0s and now >= lastGoodSend + (sendTimeout / 2))
|
|
|
|
|