use rx id on snode side of paths

set protocol on reply routing messages
pull/1576/head
Jeff Becker 3 years ago
parent e058b873b6
commit e1f90e5e5a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -190,15 +190,17 @@ namespace llarp
if (queue.size() == 0)
{
queue.emplace_back();
queue.back().protocol = type;
return queue.back().PutBuffer(pktbuf, m_Counter++);
}
auto& msg = queue.back();
if (msg.Size() + pktbuf.sz > llarp::routing::ExitPadSize)
{
queue.emplace_back();
queue.back().protocol = type;
return queue.back().PutBuffer(pktbuf, m_Counter++);
}
msg.protocol = type;
return msg.PutBuffer(pktbuf, m_Counter++);
}

@ -64,18 +64,21 @@ namespace llarp
{
service::ConvoTag tag{};
auto visit = [&tag](exit::Endpoint* const ep) -> bool {
if (ep)
tag = service::ConvoTag{ep->LocalPath().as_array()};
if (not ep)
return false;
tag = service::ConvoTag{ep->LocalPath().as_array()};
return true;
};
if (VisitEndpointsFor(PubKey{*rid}, visit) and not tag.IsZero())
return tag;
auto itr = m_SNodeSessions.find(*rid);
if (itr == m_SNodeSessions.end())
{
return std::nullopt;
}
if (auto path = itr->second->GetPathByRouter(*rid))
{
tag = service::ConvoTag{path->TXID().as_array()};
tag = service::ConvoTag{path->RXID().as_array()};
return tag;
}
return std::nullopt;
@ -144,7 +147,7 @@ namespace llarp
{
if (auto path = session->GetPathByRouter(routerID))
{
hook(service::ConvoTag{path->TXID().as_array()});
hook(service::ConvoTag{path->RXID().as_array()});
}
else
hook(std::nullopt);

Loading…
Cancel
Save