From 41c58538b556200e84535a7848cb7483d7fb24ad Mon Sep 17 00:00:00 2001 From: open-trade Date: Thu, 9 Jul 2020 02:28:36 +0800 Subject: [PATCH] pass pk to client --- libs/hbb_common | 2 +- src/rendezvous_server.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/hbb_common b/libs/hbb_common index c86ebe2..45ef8cd 160000 --- a/libs/hbb_common +++ b/libs/hbb_common @@ -1 +1 @@ -Subproject commit c86ebe2402ee1f092ce8e44e89368234708a766f +Subproject commit 45ef8cd75fcc7c94634cafcefddccd31353fdfac diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs index 1553d22..326b01a 100644 --- a/src/rendezvous_server.rs +++ b/src/rendezvous_server.rs @@ -301,8 +301,13 @@ impl RendezvousServer { &addr ); let mut msg_out = RendezvousMessage::new(); + let pk = match self.pm.get(&phs.id).await { + Some(peer) => peer.pk, + _ => Vec::new(), + }; msg_out.set_punch_hole_response(PunchHoleResponse { socket_addr: AddrMangle::encode(addr), + pk, ..Default::default() }); if let Some(socket) = socket {