aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authoropen-trade <[email protected]>2020-09-04 11:32:42 +0800
committeropen-trade <[email protected]>2020-09-04 11:32:42 +0800
commit82952784794c8ae1b5bf01389b0f3082a7e174b7 (patch)
treefa626fc150cb585dffeca5952820c1ad2e171027 /src
parent41c58538b556200e84535a7848cb7483d7fb24ad (diff)
downloadrustdesk-server-82952784794c8ae1b5bf01389b0f3082a7e174b7.tar.gz
rustdesk-server-82952784794c8ae1b5bf01389b0f3082a7e174b7.zip
more log for debugging pk mismatch
Diffstat (limited to 'src')
-rw-r--r--src/rendezvous_server.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs
index 326b01a..b26ccf6 100644
--- a/src/rendezvous_server.rs
+++ b/src/rendezvous_server.rs
@@ -7,7 +7,7 @@ use hbb_common::{
stream::{SplitSink, StreamExt},
},
log,
- protobuf::{parse_from_bytes, Message as _},
+ protobuf::Message as _,
rendezvous_proto::*,
tcp::new_listener,
tokio::{self, net::TcpStream, sync::mpsc},
@@ -144,7 +144,7 @@ impl RendezvousServer {
let mut rs = rs.clone();
tokio::spawn(async move {
while let Some(Ok(bytes)) = b.next().await {
- if let Ok(msg_in) = parse_from_bytes::<RendezvousMessage>(&bytes) {
+ if let Ok(msg_in) = RendezvousMessage::parse_from_bytes(&bytes) {
match msg_in.union {
Some(rendezvous_message::Union::punch_hole_request(ph)) => {
allow_err!(rs.handle_tcp_punch_hole_request(addr, ph.id).await);
@@ -176,7 +176,7 @@ impl RendezvousServer {
addr: SocketAddr,
socket: &mut FramedSocket,
) -> ResultType<()> {
- if let Ok(msg_in) = parse_from_bytes::<RendezvousMessage>(&bytes) {
+ if let Ok(msg_in) = RendezvousMessage::parse_from_bytes(&bytes) {
match msg_in.union {
Some(rendezvous_message::Union::register_peer(rp)) => {
// B registered
@@ -193,6 +193,7 @@ impl RendezvousServer {
self.pm.update_pk(id, addr, rk.pk);
} else {
if peer.pk != rk.pk {
+ log::warn!("Peer {} pk mismatch: {:?} vs {:?}", id, rk.pk, peer.pk);
res = register_pk_response::Result::PK_MISMATCH;
}
}