send data discarded messages

pull/15/head
Jeff Becker 6 years ago
parent a9b259985e
commit 1c849973ca
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -58,10 +58,8 @@ namespace llarp
{ {
} }
DataDiscardMessage(const PathID_t& src, const PathID_t& dst, uint64_t s) DataDiscardMessage(const PathID_t& dst, uint64_t s) : P(dst)
: P(dst)
{ {
from = src;
S = s; S = s;
version = LLARP_PROTO_VERSION; version = LLARP_PROTO_VERSION;
} }

@ -54,7 +54,6 @@ namespace llarp
TransitHop::SendRoutingMessage(llarp::routing::IMessage* msg, TransitHop::SendRoutingMessage(llarp::routing::IMessage* msg,
llarp_router* r) llarp_router* r)
{ {
msg->S = m_SequenceNum++;
byte_t tmp[MAX_LINK_MSG_SIZE - 1024]; byte_t tmp[MAX_LINK_MSG_SIZE - 1024];
auto buf = llarp::StackBuffer< decltype(tmp) >(tmp); auto buf = llarp::StackBuffer< decltype(tmp) >(tmp);
if(!msg->BEncode(&buf)) if(!msg->BEncode(&buf))
@ -151,8 +150,9 @@ namespace llarp
auto path = r->paths.GetByUpstream(r->pubkey(), msg->P); auto path = r->paths.GetByUpstream(r->pubkey(), msg->P);
if(!path) if(!path)
{ {
llarp::LogWarn("No such path for path transfer pathid=", msg->P); llarp::routing::DataDiscardMessage discarded(msg->P, msg->S);
return false; path = r->paths.GetByUpstream(r->pubkey(), msg->from);
return path && path->SendRoutingMessage(&discarded, r);
} }
byte_t tmp[service::MAX_PROTOCOL_MESSAGE_SIZE]; byte_t tmp[service::MAX_PROTOCOL_MESSAGE_SIZE];

Loading…
Cancel
Save