propagate error to client

pull/1014/head
Jeff Becker 4 years ago
parent 562f3f07ab
commit f3e96e06b2
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -259,6 +259,9 @@ namespace llarp
if(self->context->CheckPathLimitHitByIP(self->fromAddr))
{
llarp::LogError("client path build limited ", self->hop->info);
OnForwardLRCMResult(self->context->Router(), self->hop->info.rxID,
self->hop->info.downstream, self->hop->pathKey,
SendStatus::Congestion);
self->hop = nullptr;
return;
}

@ -36,7 +36,10 @@ namespace llarp
PathContext::CheckPathLimitHitByIP(const llarp::Addr& ip)
{
llarp::Addr remote = ip;
// set port to zero
remote.port(0);
// try inserting remote address by ip into decaying hash set
// if it cannot insert it has hit a limit
return not m_PathLimits.Insert(remote);
}

Loading…
Cancel
Save