diff options
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | talpid-core/src/tunnel/wireguard/mod.rs | 25 |
2 files changed, 19 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0839e3b22a..07d18cb1f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ Line wrap the file at 100 chars. Th - Remove city/country labels on map in the desktop app. ### Fixed +- Fix app getting stuck in connecting state. + #### Android - Fix crash when removing the service from foreground on Android versions below API level 24. - Fix crash that happened in certain situations when retrieving the relay list. diff --git a/talpid-core/src/tunnel/wireguard/mod.rs b/talpid-core/src/tunnel/wireguard/mod.rs index 13bff72d27..6308b1c514 100644 --- a/talpid-core/src/tunnel/wireguard/mod.rs +++ b/talpid-core/src/tunnel/wireguard/mod.rs @@ -11,6 +11,7 @@ use std::{ path::Path, sync::{mpsc, Arc, Mutex}, }; +use talpid_types::ErrorExt; pub mod config; mod connectivity_check; @@ -158,15 +159,23 @@ impl WireguardMonitor { std::thread::spawn(move || { match connectivity_monitor.establish_connectivity() { - Ok(true) => (on_event)(TunnelEvent::Up(metadata)), - Ok(false) => return, - Err(err) => { - log::error!("ConnectivityMonitor failed: {}", err); - return; + Ok(true) => { + (on_event)(TunnelEvent::Up(metadata)); + + if let Err(error) = connectivity_monitor.run() { + log::error!( + "{}", + error.display_chain_with_msg("Connectivity monitor failed") + ); + } + } + Ok(false) => log::warn!("Timeout while checking tunnel connection"), + Err(error) => { + log::error!( + "{}", + error.display_chain_with_msg("Failed to check tunnel connection") + ); } - } - if let Err(err) = connectivity_monitor.run() { - log::error!("Connectivity monitor failed - {}", err); } let _ = close_sender.send(CloseMsg::PingErr); |
