mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
FindRouterMessage is gone, also clang-format
This commit is contained in:
parent
14b9aa20ee
commit
dab1e06892
2 changed files with 2 additions and 49 deletions
|
@ -500,8 +500,7 @@ namespace llarp
|
||||||
{
|
{
|
||||||
log::info(
|
log::info(
|
||||||
link_cat, "Remote requested too many relay IDs (greater than 1/4 of what we have).");
|
link_cat, "Remote requested too many relay IDs (greater than 1/4 of what we have).");
|
||||||
m.respond(
|
m.respond(serialize_response({{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
|
||||||
serialize_response({{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,8 +509,7 @@ namespace llarp
|
||||||
{
|
{
|
||||||
if (sv.size() != RouterID::SIZE)
|
if (sv.size() != RouterID::SIZE)
|
||||||
{
|
{
|
||||||
m.respond(serialize_response(
|
m.respond(serialize_response({{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
|
||||||
{{messages::STATUS_KEY, RCFetchMessage::INVALID_REQUEST}}));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
explicit_relays.emplace(reinterpret_cast<const byte_t*>(sv.data()));
|
explicit_relays.emplace(reinterpret_cast<const byte_t*>(sv.data()));
|
||||||
|
|
|
@ -4,51 +4,6 @@
|
||||||
|
|
||||||
namespace llarp
|
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
|
namespace FindIntroMessage
|
||||||
{
|
{
|
||||||
inline auto NOT_FOUND = "NOT FOUND"sv;
|
inline auto NOT_FOUND = "NOT FOUND"sv;
|
||||||
|
|
Loading…
Reference in a new issue