diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-21 20:22:56 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-21 20:22:56 +0200 |
commit | 4934ed726d51913afd97ca937d0ece39ef8b7371 (patch) | |
tree | ad9560d819bfcbab9e35ee806bd9b2adaa8f9de5 /src/netapp.rs | |
parent | 7d148c7e764d563efa3bccc0f14f50867db38ef1 (diff) | |
download | netapp-4934ed726d51913afd97ca937d0ece39ef8b7371.tar.gz netapp-4934ed726d51913afd97ca937d0ece39ef8b7371.zip |
Propose alternative API
Diffstat (limited to 'src/netapp.rs')
-rw-r--r-- | src/netapp.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/netapp.rs b/src/netapp.rs index 32a5c23..0cebac0 100644 --- a/src/netapp.rs +++ b/src/netapp.rs @@ -404,6 +404,7 @@ impl NetApp { PRIO_NORMAL, ) .await + .map(|_| ()) .log_err("Sending hello message"); }); } @@ -432,7 +433,8 @@ 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: Req<HelloMessage>, from: NodeID) -> Resp<HelloMessage> { + let msg = msg.msg(); debug!("Hello from {:?}: {:?}", hex::encode(&from[..8]), msg); if let Some(h) = self.on_connected_handler.load().as_ref() { if let Some(c) = self.server_conns.read().unwrap().get(&from) { @@ -441,5 +443,6 @@ impl EndpointHandler<HelloMessage> for NetApp { h(from, remote_addr, true); } } + Resp::new(()) } } |