aboutsummaryrefslogtreecommitdiff
path: root/src/netapp.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-07-21 20:22:56 +0200
committerAlex Auvolat <alex@adnab.me>2022-07-21 20:22:56 +0200
commit4934ed726d51913afd97ca937d0ece39ef8b7371 (patch)
treead9560d819bfcbab9e35ee806bd9b2adaa8f9de5 /src/netapp.rs
parent7d148c7e764d563efa3bccc0f14f50867db38ef1 (diff)
downloadnetapp-4934ed726d51913afd97ca937d0ece39ef8b7371.tar.gz
netapp-4934ed726d51913afd97ca937d0ece39ef8b7371.zip
Propose alternative API
Diffstat (limited to 'src/netapp.rs')
-rw-r--r--src/netapp.rs5
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(())
}
}