Merge pull request #1082 from majestrate/log-build-after-send-2020-02-06

only mark path build success if delivered to first hop
pull/1087/head
Jeff 5 years ago committed by GitHub
commit 4bc5b52762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -134,16 +134,26 @@ namespace llarp
{
const RouterID remote = ctx->path->Upstream();
const ILinkMessage* msg = &ctx->LRCM;
if(ctx->router->SendToOrQueue(remote, msg))
auto sentHandler = [ctx](auto status) {
if(status == SendStatus::Success)
{
ctx->router->pathContext().AddOwnPath(ctx->pathset, ctx->path);
ctx->pathset->PathBuildStarted(ctx->path);
}
else
{
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());
// add own path
ctx->router->pathContext().AddOwnPath(ctx->pathset, ctx->path);
ctx->pathset->PathBuildStarted(ctx->path);
}
else
LogError(ctx->pathset->Name(), " failed to send LRCM to ", remote);
LogError(ctx->pathset->Name(), " failed to queue LRCM to ", remote);
}
}

Loading…
Cancel
Save