fix path reference leak (#1451)

pull/1455/head
Jeff 4 years ago committed by GitHub
parent 34c7f0da0d
commit e66522b9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -320,6 +320,7 @@ namespace llarp
{
if (itr->second->Expired(now))
{
itr->second->m_PathSet->RemovePath(itr->second);
itr = map.erase(itr);
}
else

@ -141,8 +141,9 @@ namespace llarp
else
{
LogError(ctx->pathset->Name(), " failed to send LRCM to ", ctx->path->Upstream());
ctx->pathset->HandlePathBuildFailed(std::move(ctx->path));
ctx->path->EnterState(path::ePathFailed, ctx->router->Now());
}
ctx->path = nullptr;
ctx->pathset = nullptr;
};
if (ctx->router->SendToOrQueue(remote, msg, sentHandler))

@ -337,6 +337,12 @@ namespace llarp
m_BuildStats.fails++;
}
void
PathSet::HandlePathDied(Path_ptr p)
{
LogWarn(Name(), " path ", p->ShortName(), " died");
}
void
PathSet::PathBuildStarted(Path_ptr p)
{

@ -136,7 +136,7 @@ namespace llarp
/// a path died now what?
virtual void
HandlePathDied(Path_ptr path) = 0;
HandlePathDied(Path_ptr path);
bool
GetNewestIntro(service::Introduction& intro) const;

@ -317,8 +317,7 @@ namespace llarp
}
std::unique_ptr<IServiceLookup> lookup = std::move(itr->second);
lookups.erase(itr);
if (not lookup->HandleIntrosetResponse(remote))
lookups.emplace(msg->txid, std::move(lookup));
lookup->HandleIntrosetResponse(remote);
return true;
}
@ -1065,9 +1064,11 @@ namespace llarp
return true;
}
void Endpoint::HandlePathDied(path::Path_ptr)
void
Endpoint::HandlePathDied(path::Path_ptr p)
{
RegenAndPublishIntroSet(true);
path::Builder::HandlePathDied(p);
}
bool

@ -153,6 +153,13 @@ namespace llarp
path::Builder::HandlePathBuildTimeout(p);
}
void
OutboundContext::HandlePathBuildFailed(path::Path_ptr p)
{
ShiftIntroRouter(p->Endpoint());
path::Builder::HandlePathBuildFailed(p);
}
void
OutboundContext::HandlePathBuilt(path::Path_ptr p)
{

@ -103,6 +103,9 @@ namespace llarp
void
HandlePathBuildTimeout(path::Path_ptr path) override;
void
HandlePathBuildFailed(path::Path_ptr path) override;
bool
SelectHop(
llarp_nodedb* db,

Loading…
Cancel
Save