Add some notes/comments about DHT message handling

pull/1147/head
Stephen Shelton 4 years ago
parent 6b906de00d
commit f61cd1a7da
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C

@ -499,6 +499,10 @@ namespace llarp
router->PersistSessionUntil(peer, now + 1min);
}
// this function handles incoming DHT messages sent down a path by a client
// note that IMessage here is different than that found in the routing
// namespace. by the time this is called, we are inside
// llarp::routing::DHTMessage::HandleMessage()
bool
Context::RelayRequestForPath(const llarp::PathID_t& id, const IMessage& msg)
{

@ -710,6 +710,8 @@ namespace llarp
return false;
}
/// this is the Client's side of handling a DHT message. it's handled
/// in-place.
bool
Path::HandleDHTMessage(const dht::IMessage& msg, AbstractRouter* r)
{

@ -262,6 +262,8 @@ namespace llarp
m_DownstreamQueue = nullptr;
}
/// this is where a DHT message is handled at the end of a path, that is,
/// where a SNode receives a DHT message from a client along a path.
bool
TransitHop::HandleDHTMessage(const llarp::dht::IMessage& msg,
AbstractRouter* r)

@ -45,6 +45,11 @@ namespace llarp
return bencode_end(buf);
}
/// 'h' here is either TransitHop or Path.
/// TransitHop chains to dht::Context::RelayRequestForPath and is where the
/// end of a path handles a client's DHT message Path handles the message
/// (e.g. dht::IMessage::HandleMessage()) in-place and is the case where a
/// client receives a DHT message
bool
DHTMessage::HandleMessage(IMessageHandler* h, AbstractRouter* r) const
{

Loading…
Cancel
Save