aboutsummaryrefslogtreecommitdiff
path: root/src/peering/fullmesh.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-22 10:55:37 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-22 10:55:37 +0200
commitc358fe3c92da8a8454e461484737efe2a14dfd73 (patch)
treedb540e2e25a96585686826ef66f3552decee96df /src/peering/fullmesh.rs
parent4934ed726d51913afd97ca937d0ece39ef8b7371 (diff)
downloadnetapp-c358fe3c92da8a8454e461484737efe2a14dfd73.tar.gz
netapp-c358fe3c92da8a8454e461484737efe2a14dfd73.zip
Hide streaming versions as much as possible
Diffstat (limited to 'src/peering/fullmesh.rs')
-rw-r--r--src/peering/fullmesh.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/peering/fullmesh.rs b/src/peering/fullmesh.rs
index 9b7b666..ccbd0ba 100644
--- a/src/peering/fullmesh.rs
+++ b/src/peering/fullmesh.rs
@@ -583,14 +583,13 @@ impl FullMeshPeeringStrategy {
#[async_trait]
impl EndpointHandler<PingMessage> for FullMeshPeeringStrategy {
- async fn handle(self: &Arc<Self>, ping: Req<PingMessage>, from: NodeID) -> Resp<PingMessage> {
- let ping = ping.msg();
+ async fn handle(self: &Arc<Self>, ping: &PingMessage, from: NodeID) -> PingMessage {
let ping_resp = PingMessage {
id: ping.id,
peer_list_hash: self.known_hosts.read().unwrap().hash,
};
debug!("Ping from {}", hex::encode(&from[..8]));
- Resp::new(ping_resp)
+ ping_resp
}
}
@@ -598,12 +597,11 @@ impl EndpointHandler<PingMessage> for FullMeshPeeringStrategy {
impl EndpointHandler<PeerListMessage> for FullMeshPeeringStrategy {
async fn handle(
self: &Arc<Self>,
- peer_list: Req<PeerListMessage>,
+ peer_list: &PeerListMessage,
_from: NodeID,
- ) -> Resp<PeerListMessage> {
- let peer_list = peer_list.msg();
+ ) -> PeerListMessage {
self.handle_peer_list(&peer_list.list[..]);
let peer_list = KnownHosts::map_into_vec(&self.known_hosts.read().unwrap().list);
- Resp::new(PeerListMessage { list: peer_list })
+ PeerListMessage { list: peer_list }
}
}