service node logic change: simplify transit hop behavior to send protocol frames directly from a path transfer message

pull/1576/head
Jeff Becker 3 years ago
parent 3f9e51e391
commit 0046de3e7a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -441,18 +441,8 @@ namespace llarp
{
return SendRoutingMessage(discarded, r);
}
std::array<byte_t, service::MAX_PROTOCOL_MESSAGE_SIZE> tmp;
llarp_buffer_t buf{tmp};
if (!msg.T.BEncode(&buf))
{
llarp::LogWarn(info, " failed to transfer data message, encode failed");
return SendRoutingMessage(discarded, r);
}
// rewind
buf.sz = buf.cur - buf.base;
buf.cur = buf.base;
// send
if (path->HandleDownstream(buf, msg.Y, r))
// send routing message
if (path->SendRoutingMessage(msg.T, r))
{
m_FlushOthers.emplace(path);
return true;

Loading…
Cancel
Save