mirror of
https://github.com/rustdesk/rustdesk-server.git
synced 2026-03-10 22:13:14 +08:00
fix slow connection, '/' in pub key, and hbbr wait for key, and possible
solution for https://github.com/rustdesk/rustdesk-server/issues/24
This commit is contained in:
@@ -11,7 +11,10 @@ use tokio_socks::{IntoTargetAddr, TargetAddr};
|
||||
|
||||
fn to_socket_addr(host: &str) -> ResultType<SocketAddr> {
|
||||
use std::net::ToSocketAddrs;
|
||||
host.to_socket_addrs()?.next().context("Failed to solve")
|
||||
host.to_socket_addrs()?
|
||||
.filter(|x| x.is_ipv4())
|
||||
.next()
|
||||
.context("Failed to solve")
|
||||
}
|
||||
|
||||
pub fn get_target_addr(host: &str) -> ResultType<TargetAddr<'static>> {
|
||||
@@ -60,8 +63,9 @@ pub async fn connect_tcp<'t, T: IntoTargetAddr<'t>>(
|
||||
.await
|
||||
} else {
|
||||
let addr = std::net::ToSocketAddrs::to_socket_addrs(&target_addr)?
|
||||
.filter(|x| x.is_ipv4())
|
||||
.next()
|
||||
.context("Invalid target addr")?;
|
||||
.context("Invalid target addr, no valid ipv4 address can be resolved.")?;
|
||||
Ok(FramedStream::new(addr, local, ms_timeout).await?)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user