aboutsummaryrefslogtreecommitdiff
path: root/src/conn.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-12-02 18:10:07 +0100
committerAlex Auvolat <alex@adnab.me>2020-12-02 18:10:07 +0100
commit46fae5d138cb7c0a74e2a8c7837541f18400ccf4 (patch)
treef4456300e4ed12ffa6dd918236ad74d4c89b0249 /src/conn.rs
parent9ed776d16ad40a4d47900814b2b7f1ef1c02fa4e (diff)
downloadnetapp-46fae5d138cb7c0a74e2a8c7837541f18400ccf4.tar.gz
netapp-46fae5d138cb7c0a74e2a8c7837541f18400ccf4.zip
Better handle requests to ourself
Diffstat (limited to 'src/conn.rs')
-rw-r--r--src/conn.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conn.rs b/src/conn.rs
index 9b60d2a..df3b7cf 100644
--- a/src/conn.rs
+++ b/src/conn.rs
@@ -107,7 +107,8 @@ impl RecvLoop for ServerConn {
let kind = u32::from_be_bytes(kind_bytes);
if let Some(handler) = self.netapp.msg_handlers.load().get(&kind) {
- let resp = handler(self.peer_pk.clone(), bytes.slice(5..)).await;
+ let net_handler = &handler.net_handler;
+ let resp = net_handler(self.peer_pk.clone(), bytes.slice(5..)).await;
self.resp_send
.send((id, prio, resp))
.log_err("ServerConn recv_handler send resp");
@@ -240,7 +241,7 @@ impl ClientConn {
Ok(())
}
- pub async fn request<T>(
+ pub(crate) async fn request<T>(
self: Arc<Self>,
rq: T,
prio: RequestPriority,