FindRouterMessage is gone, also clang-format

This commit is contained in:
Thomas Winget 2023-11-27 13:42:39 -05:00
parent 14b9aa20ee
commit dab1e06892
2 changed files with 2 additions and 49 deletions

View File

@ -500,8 +500,7 @@ namespace llarp
{
log::info(
link_cat, "Remote requested too many relay IDs (greater than 1/4 of what we have).");
m.respond(
serialize_response({{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
m.respond(serialize_response({{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
return;
}
@ -510,8 +509,7 @@ namespace llarp
{
if (sv.size() != RouterID::SIZE)
{
m.respond(serialize_response(
{{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
m.respond(serialize_response({{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
return;
}
explicit_relays.emplace(reinterpret_cast<const byte_t*>(sv.data()));

View File

@ -4,51 +4,6 @@
namespace llarp
{
namespace FindRouterMessage
{
inline auto RETRY_EXP = "RETRY AS EXPLORATORY"sv;
inline auto RETRY_ITER = "RETRY AS ITERATIVE"sv;
inline auto RETRY_NEW = "RETRY WITH NEW RECIPIENT"sv;
inline static std::string
serialize(const RouterID& rid, bool is_iterative, bool is_exploratory)
{
oxenc::bt_dict_producer btdp;
try
{
btdp.append("E", is_exploratory ? 1 : 0);
btdp.append("I", is_iterative ? 1 : 0);
btdp.append("K", rid.ToView());
}
catch (...)
{
log::error(link_cat, "Error: FindRouterMessage failed to bt encode contents!");
}
return std::move(btdp).str();
}
inline static std::string
serialize(const std::string& rid, bool is_iterative, bool is_exploratory)
{
oxenc::bt_dict_producer btdp;
try
{
btdp.append("E", is_exploratory ? 1 : 0);
btdp.append("I", is_iterative ? 1 : 0);
btdp.append("K", std::move(rid));
}
catch (...)
{
log::error(link_cat, "Error: FindRouterMessage failed to bt encode contents!");
}
return std::move(btdp).str();
}
} // namespace FindRouterMessage
namespace FindIntroMessage
{
inline auto NOT_FOUND = "NOT FOUND"sv;