From 8709b6bc933c0f48e55dc9ef176c5c2ca79ce3d6 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 27 Jun 2023 22:24:08 +0800 Subject: [PATCH] reset onlinestatus after test rendezvous servers --- src/common.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common.rs b/src/common.rs index b20a1b245..ab3e087a3 100644 --- a/src/common.rs +++ b/src/common.rs @@ -668,11 +668,13 @@ pub async fn get_nat_type(ms_timeout: u64) -> i32 { crate::ipc::get_nat_type(ms_timeout).await } -// #[cfg(any(target_os = "android", target_os = "ios", feature = "cli"))] +// used for client to test which server is faster in case stop-servic=Y #[tokio::main(flavor = "current_thread")] async fn test_rendezvous_server_() { let servers = Config::get_rendezvous_servers(); - Config::reset_online(); + if servers.len() <= 1 { + return; + } let mut futs = Vec::new(); for host in servers { futs.push(tokio::spawn(async move { @@ -692,6 +694,7 @@ async fn test_rendezvous_server_() { })); } join_all(futs).await; + Config::reset_online(); } // #[cfg(any(target_os = "android", target_os = "ios", feature = "cli"))]