From fe61522f2aceea1b2681fe8493a54d321b952218 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 26 May 2021 18:03:44 +0200 Subject: tunnel: retry DNS resolution for 10 seconds This has several problems: 1) it blocks the main thread; 2) it doesn't distinguish between a permanent error and a transient one; 3) the 10 seconds is hard coded; 4) there's no way for the user to cancel it. We'll have to improve this. Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/util/ErrorMessages.kt | 3 ++- ui/src/main/res/values/strings.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/src/main') diff --git a/ui/src/main/java/com/wireguard/android/util/ErrorMessages.kt b/ui/src/main/java/com/wireguard/android/util/ErrorMessages.kt index 1ee0dafc..d8d53b09 100644 --- a/ui/src/main/java/com/wireguard/android/util/ErrorMessages.kt +++ b/ui/src/main/java/com/wireguard/android/util/ErrorMessages.kt @@ -36,7 +36,8 @@ object ErrorMessages { BackendException.Reason.VPN_NOT_AUTHORIZED to R.string.vpn_not_authorized_error, BackendException.Reason.UNABLE_TO_START_VPN to R.string.vpn_start_error, BackendException.Reason.TUN_CREATION_ERROR to R.string.tun_create_error, - BackendException.Reason.GO_ACTIVATION_ERROR_CODE to R.string.tunnel_on_error + BackendException.Reason.GO_ACTIVATION_ERROR_CODE to R.string.tunnel_on_error, + BackendException.Reason.DNS_RESOLUTION_FAILURE to R.string.tunnel_dns_failure ) private val KFE_FORMAT_MAP = mapOf( Key.Format.BASE64 to R.string.key_length_explanation_base64, diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index 812b2192..bb4466aa 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -214,6 +214,7 @@ Add a tunnel using the blue button Tunnel Name Unable to turn tunnel on (wgTurnOn returned %d) + Unable to resolve DNS hostname: ā€œ%sā€ Unable to rename tunnel: %s Successfully renamed tunnel to ā€œ%sā€ Go userspace -- cgit v1.2.3