aboutsummaryrefslogtreecommitdiff
path: root/src/peering/basalt.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-14 14:54:48 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-14 16:11:07 +0200
commit8a0bfa0ff6bc6b79c91c8e635dd00c2f687ec401 (patch)
tree15179701a037f4eeb39a61f68ea723f26ae899c5 /src/peering/basalt.rs
parentfba49cf93dedae21cbe884db8c0124c0d3c88730 (diff)
downloadnetapp-8a0bfa0ff6bc6b79c91c8e635dd00c2f687ec401.tar.gz
netapp-8a0bfa0ff6bc6b79c91c8e635dd00c2f687ec401.zip
Change call() to take a ref to the message to be sent
Handlers also receive a ref
Diffstat (limited to 'src/peering/basalt.rs')
-rw-r--r--src/peering/basalt.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peering/basalt.rs b/src/peering/basalt.rs
index cdb0605..7f77995 100644
--- a/src/peering/basalt.rs
+++ b/src/peering/basalt.rs
@@ -331,7 +331,7 @@ impl Basalt {
async fn do_pull(self: Arc<Self>, peer: NodeID) {
match self
.pull_endpoint
- .call(&peer, PullMessage {}, PRIO_NORMAL)
+ .call(&peer, &PullMessage {}, PRIO_NORMAL)
.await
{
Ok(resp) => {
@@ -346,7 +346,7 @@ impl Basalt {
async fn do_push(self: Arc<Self>, peer: NodeID) {
let push_msg = self.make_push_message();
- match self.push_endpoint.call(&peer, push_msg, PRIO_NORMAL).await {
+ match self.push_endpoint.call(&peer, &push_msg, PRIO_NORMAL).await {
Ok(_) => {
trace!("KYEV PEXo {}", hex::encode(peer));
}
@@ -468,14 +468,14 @@ impl Basalt {
#[async_trait]
impl EndpointHandler<PullMessage> for Basalt {
- async fn handle(self: &Arc<Self>, _pullmsg: PullMessage, _from: NodeID) -> PushMessage {
+ async fn handle(self: &Arc<Self>, _pullmsg: &PullMessage, _from: NodeID) -> PushMessage {
self.make_push_message()
}
}
#[async_trait]
impl EndpointHandler<PushMessage> for Basalt {
- async fn handle(self: &Arc<Self>, pushmsg: PushMessage, _from: NodeID) {
+ async fn handle(self: &Arc<Self>, pushmsg: &PushMessage, _from: NodeID) {
self.handle_peer_list(&pushmsg.peers[..]);
}
}