From f3e96e06b237855889c5d81f45e5bab0debeeded Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 30 Dec 2019 15:55:56 -0500 Subject: [PATCH] propagate error to client --- llarp/messages/relay_commit.cpp | 3 +++ llarp/path/path_context.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/llarp/messages/relay_commit.cpp b/llarp/messages/relay_commit.cpp index 1de8ff417..1c744d60d 100644 --- a/llarp/messages/relay_commit.cpp +++ b/llarp/messages/relay_commit.cpp @@ -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; } diff --git a/llarp/path/path_context.cpp b/llarp/path/path_context.cpp index 3f032cd6d..249a58dc3 100644 --- a/llarp/path/path_context.cpp +++ b/llarp/path/path_context.cpp @@ -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); }