mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
Merge pull request #1082 from majestrate/log-build-after-send-2020-02-06
only mark path build success if delivered to first hop
This commit is contained in:
commit
4bc5b52762
@ -134,16 +134,26 @@ namespace llarp
|
|||||||
{
|
{
|
||||||
const RouterID remote = ctx->path->Upstream();
|
const RouterID remote = ctx->path->Upstream();
|
||||||
const ILinkMessage* msg = &ctx->LRCM;
|
const ILinkMessage* msg = &ctx->LRCM;
|
||||||
if(ctx->router->SendToOrQueue(remote, msg))
|
auto sentHandler = [ctx](auto status) {
|
||||||
|
if(status == SendStatus::Success)
|
||||||
{
|
{
|
||||||
// persist session with router until this path is done
|
|
||||||
ctx->router->PersistSessionUntil(remote, ctx->path->ExpireTime());
|
|
||||||
// add own path
|
|
||||||
ctx->router->pathContext().AddOwnPath(ctx->pathset, ctx->path);
|
ctx->router->pathContext().AddOwnPath(ctx->pathset, ctx->path);
|
||||||
ctx->pathset->PathBuildStarted(ctx->path);
|
ctx->pathset->PathBuildStarted(ctx->path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogError(ctx->pathset->Name(), " failed to send LRCM to ", remote);
|
{
|
||||||
|
LogError(ctx->pathset->Name(), " failed to send LRCM to ",
|
||||||
|
ctx->path->Upstream());
|
||||||
|
ctx->pathset->HandlePathBuildFailed(ctx->path);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if(ctx->router->SendToOrQueue(remote, msg, sentHandler))
|
||||||
|
{
|
||||||
|
// persist session with router until this path is done
|
||||||
|
ctx->router->PersistSessionUntil(remote, ctx->path->ExpireTime());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
LogError(ctx->pathset->Name(), " failed to queue LRCM to ", remote);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user