|
|
|
@ -280,8 +280,7 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
else if(st == ePathEstablished && _status == ePathBuilding)
|
|
|
|
|
{
|
|
|
|
|
LogInfo("path ", Name(), " is built, took ",
|
|
|
|
|
Time_t(now - buildStarted).count(), " ms");
|
|
|
|
|
LogInfo("path ", Name(), " is built, took ", now - buildStarted, " ms");
|
|
|
|
|
}
|
|
|
|
|
else if(st == ePathTimeout && _status == ePathEstablished)
|
|
|
|
|
{
|
|
|
|
@ -299,7 +298,7 @@ namespace llarp
|
|
|
|
|
util::StatusObject
|
|
|
|
|
PathHopConfig::ExtractStatus() const
|
|
|
|
|
{
|
|
|
|
|
util::StatusObject obj{{"lifetime", lifetime.count()},
|
|
|
|
|
util::StatusObject obj{{"lifetime", to_json(lifetime)},
|
|
|
|
|
{"router", rc.pubkey.ToHex()},
|
|
|
|
|
{"txid", txID.ToHex()},
|
|
|
|
|
{"rxid", rxID.ToHex()}};
|
|
|
|
@ -311,17 +310,18 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
auto now = llarp::time_now_ms();
|
|
|
|
|
|
|
|
|
|
util::StatusObject obj{{"intro", intro.ExtractStatus()},
|
|
|
|
|
{"lastRecvMsg", m_LastRecvMessage.count()},
|
|
|
|
|
{"lastLatencyTest", m_LastLatencyTestTime.count()},
|
|
|
|
|
{"buildStarted", buildStarted.count()},
|
|
|
|
|
{"expired", Expired(now)},
|
|
|
|
|
{"expiresSoon", ExpiresSoon(now)},
|
|
|
|
|
{"expiresAt", ExpireTime().count()},
|
|
|
|
|
{"ready", IsReady()},
|
|
|
|
|
{"txRateCurrent", m_LastTXRate},
|
|
|
|
|
{"rxRateCurrent", m_LastRXRate},
|
|
|
|
|
{"hasExit", SupportsAnyRoles(ePathRoleExit)}};
|
|
|
|
|
util::StatusObject obj{
|
|
|
|
|
{"intro", intro.ExtractStatus()},
|
|
|
|
|
{"lastRecvMsg", to_json(m_LastRecvMessage)},
|
|
|
|
|
{"lastLatencyTest", to_json(m_LastLatencyTestTime)},
|
|
|
|
|
{"buildStarted", to_json(buildStarted)},
|
|
|
|
|
{"expired", Expired(now)},
|
|
|
|
|
{"expiresSoon", ExpiresSoon(now)},
|
|
|
|
|
{"expiresAt", to_json(ExpireTime())},
|
|
|
|
|
{"ready", IsReady()},
|
|
|
|
|
{"txRateCurrent", m_LastTXRate},
|
|
|
|
|
{"rxRateCurrent", m_LastRXRate},
|
|
|
|
|
{"hasExit", SupportsAnyRoles(ePathRoleExit)}};
|
|
|
|
|
|
|
|
|
|
std::vector< util::StatusObject > hopsObj;
|
|
|
|
|
std::transform(hops.begin(), hops.end(), std::back_inserter(hopsObj),
|
|
|
|
@ -379,8 +379,8 @@ namespace llarp
|
|
|
|
|
m_RXRate = 0;
|
|
|
|
|
m_TXRate = 0;
|
|
|
|
|
|
|
|
|
|
m_UpstreamReplayFilter.Decay(Time_t(now));
|
|
|
|
|
m_DownstreamReplayFilter.Decay(Time_t(now));
|
|
|
|
|
m_UpstreamReplayFilter.Decay(now);
|
|
|
|
|
m_DownstreamReplayFilter.Decay(now);
|
|
|
|
|
|
|
|
|
|
if(_status == ePathBuilding)
|
|
|
|
|
{
|
|
|
|
@ -391,8 +391,7 @@ namespace llarp
|
|
|
|
|
const auto dlt = now - buildStarted;
|
|
|
|
|
if(dlt >= path::build_timeout)
|
|
|
|
|
{
|
|
|
|
|
LogWarn(Name(), " waited for ", dlt.count(),
|
|
|
|
|
"ms and no path was built");
|
|
|
|
|
LogWarn(Name(), " waited for ", dlt, " and no path was built");
|
|
|
|
|
r->routerProfiling().MarkPathFail(this);
|
|
|
|
|
EnterState(ePathExpired, now);
|
|
|
|
|
return;
|
|
|
|
@ -418,8 +417,7 @@ namespace llarp
|
|
|
|
|
const auto delay = now - m_LastRecvMessage;
|
|
|
|
|
if(m_CheckForDead && m_CheckForDead(shared_from_this(), delay))
|
|
|
|
|
{
|
|
|
|
|
LogWarn(Name(), " waited for ", dlt.count(),
|
|
|
|
|
"ms and path is unresponsive");
|
|
|
|
|
LogWarn(Name(), " waited for ", dlt, " and path is unresponsive");
|
|
|
|
|
r->routerProfiling().MarkPathFail(this);
|
|
|
|
|
EnterState(ePathTimeout, now);
|
|
|
|
|
}
|
|
|
|
@ -428,8 +426,7 @@ namespace llarp
|
|
|
|
|
{
|
|
|
|
|
if(m_CheckForDead && m_CheckForDead(shared_from_this(), dlt))
|
|
|
|
|
{
|
|
|
|
|
LogWarn(Name(), " waited for ", dlt.count(),
|
|
|
|
|
"ms and path looks dead");
|
|
|
|
|
LogWarn(Name(), " waited for ", dlt, " and path looks dead");
|
|
|
|
|
r->routerProfiling().MarkPathFail(this);
|
|
|
|
|
EnterState(ePathTimeout, now);
|
|
|
|
|
}
|
|
|
|
@ -705,8 +702,7 @@ namespace llarp
|
|
|
|
|
if(m_BuiltHook)
|
|
|
|
|
m_BuiltHook(shared_from_this());
|
|
|
|
|
m_BuiltHook = nullptr;
|
|
|
|
|
LogDebug("path latency is now ", intro.latency.count(), " for ",
|
|
|
|
|
Name());
|
|
|
|
|
LogDebug("path latency is now ", intro.latency, " for ", Name());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -798,7 +794,7 @@ namespace llarp
|
|
|
|
|
}
|
|
|
|
|
LogInfo(Name(), " ", Endpoint(), " Rejected exit");
|
|
|
|
|
MarkActive(r->Now());
|
|
|
|
|
return InformExitResult(Time_t(msg.B));
|
|
|
|
|
return InformExitResult(llarp_time_t(msg.B));
|
|
|
|
|
}
|
|
|
|
|
LogError(Name(), " got unwarranted RXM");
|
|
|
|
|
return false;
|
|
|
|
|