aboutsummaryrefslogtreecommitdiff
path: root/src/netapp.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/netapp.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/netapp.rs')
-rw-r--r--src/netapp.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/netapp.rs b/src/netapp.rs
index 7fe1e71..a7a3acf 100644
--- a/src/netapp.rs
+++ b/src/netapp.rs
@@ -366,7 +366,7 @@ impl NetApp {
hello_endpoint
.call(
&conn.peer_id,
- HelloMessage {
+ &HelloMessage {
server_addr,
server_port,
},
@@ -401,7 +401,7 @@ impl NetApp {
#[async_trait]
impl EndpointHandler<HelloMessage> for NetApp {
- async fn handle(self: &Arc<Self>, msg: HelloMessage, from: NodeID) {
+ async fn handle(self: &Arc<Self>, msg: &HelloMessage, from: NodeID) {
if let Some(h) = self.on_connected_handler.load().as_ref() {
if let Some(c) = self.server_conns.read().unwrap().get(&from) {
let remote_ip = msg.server_addr.unwrap_or_else(|| c.remote_addr.ip());