You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking if we could refactor InboundPutRecordRequest and InboundAddProviderRequest into a FilterRequest or something similar inside KademliaEvent.
So instead of this
KademliaEvent::InboundPutRecordRequest{
source,
connection,
record,} => {println!("inbound put record request {:?} {:?}",
std::str::from_utf8(record.key.as_ref()).unwrap(),
std::str::from_utf8(&record.value).unwrap(),
);self.kademlia.store_mut().put(record);}
we could have something like this:
KademliaEvent::FilterRequest{request} => {match request {KademliaFilter::InboundPutRecordRequest{record, ..} => {println!("inbound put record request {:?} {:?}",
std::str::from_utf8(record.key.as_ref()).unwrap(),
std::str::from_utf8(&record.value).unwrap(),
);self.kademlia.store_mut().put(record);}
_ => {}}}
The text was updated successfully, but these errors were encountered:
I am fine combining the InboundPutRecordRequest and InboundAddProviderRequest under a single KademliaEvent variant.
I find FilterRequest a bit misleading as the remote is not actually requesting the local node to filter, but to store.
Today, when filtering is enabled, an inbound request is reported both through KademliaEvent::InboundPutRecordRequest and KademliaEvent::InboundRequestServed. We could rename the latter to e.g. KademliaEvent::InboundRequest and include the actual record in InboundRequest::PutRecord when filtering is enabled.
What do you think of the latter suggestion @supercmmetry?
I was thinking if we could refactor
InboundPutRecordRequest
andInboundAddProviderRequest
into aFilterRequest
or something similar insideKademliaEvent
.So instead of this
we could have something like this:
The text was updated successfully, but these errors were encountered: