An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.
Rust androidanydeskdartflatpakflutterflutter-appsioslinuxmacosp2prdpremote-controlremote-desktoprustrust-langteamviewervncwaylandwindows
smaller timeout for android and self-hosting
rustdesk964c2ed2b5f1
diff --git a/src/client.rs b/src/client.rsindex 28c262ed0..45eac5abd 100644--- a/src/client.rs+++ b/src/client.rs@@ -1531,7 +1531,7 @@ impl LoginConfigHandler {} else if q == "custom" {let config = self.load_config();let allow_more =- !crate::ui_interface::using_public_server() || self.direct == Some(true);+ !crate::using_public_server() || self.direct == Some(true);let quality = if config.custom_image_quality.is_empty() {50} else {diff --git a/src/common.rs b/src/common.rsindex 09ebb6ba2..fde8ecfa5 100644--- a/src/common.rs+++ b/src/common.rs@@ -1328,3 +1328,10 @@ pub fn create_symmetric_key_msg(their_pk_b: [u8; 32]) -> (Bytes, Bytes, secretbolet sealed_key = box_::seal(&key.0, &nonce, &their_pk_b, &out_sk_b);(Vec::from(our_pk_b.0).into(), sealed_key.into(), key)}++#[inline]+pub fn using_public_server() -> bool {+ option_env!("RENDEZVOUS_SERVER").unwrap_or("").is_empty()+ && crate::get_custom_rendezvous_server(get_option("custom-rendezvous-server")).is_empty()+}+diff --git a/src/rendezvous_mediator.rs b/src/rendezvous_mediator.rsindex 233f31e57..7fc6d8927 100644--- a/src/rendezvous_mediator.rs+++ b/src/rendezvous_mediator.rs@@ -222,8 +222,12 @@ impl RendezvousMediator {last_timer = now;let expired = last_register_resp.map(|x| x.elapsed().as_millis() as i64 >= REG_INTERVAL).unwrap_or(true);let timeout = last_register_sent.map(|x| x.elapsed().as_millis() as i64 >= reg_timeout).unwrap_or(false);- if timeout && reg_timeout < MAX_REG_TIMEOUT {- reg_timeout += MIN_REG_TIMEOUT;+ // temporarily disable exponential backoff for android before we add wakeup trigger to force connect in android+ #[cfg(not(any(target_os = "android", target_os = "ios")))]+ if crate::using_public_server() { // only turn on this for public server, may help DDNS self-hosting user.+ if timeout && reg_timeout < MAX_REG_TIMEOUT {+ reg_timeout += MIN_REG_TIMEOUT;+ }}if timeout || (last_register_sent.is_none() && expired) {if timeout {diff --git a/src/ui.rs b/src/ui.rsindex 8c4f4b3d9..c6916e6c8 100644--- a/src/ui.rs+++ b/src/ui.rs@@ -259,7 +259,7 @@ impl UI {}fn using_public_server(&self) -> bool {- using_public_server()+ crate::using_public_server()}fn get_options(&self) -> Value {diff --git a/src/ui_interface.rs b/src/ui_interface.rsindex 86c5037bb..dbcf525db 100644--- a/src/ui_interface.rs+++ b/src/ui_interface.rs@@ -248,12 +248,6 @@ pub fn set_peer_option(id: String, name: String, value: String) {c.store(&id);}-#[inline]-pub fn using_public_server() -> bool {- option_env!("RENDEZVOUS_SERVER").unwrap_or("").is_empty()- && crate::get_custom_rendezvous_server(get_option("custom-rendezvous-server")).is_empty()-}-#[inline]pub fn get_options() -> String {let options = {@@ -1114,11 +1108,10 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:allow_err!(c.send(&data).await);}_ = timer.tick() => {- let now = time::Instant::now();if last_timer.elapsed() < TIMER_OUT {continue;}- last_timer = now;+ last_timer = time::Instant::now();c.send(&ipc::Data::OnlineStatus(None)).await.ok();c.send(&ipc::Data::Options(None)).await.ok();