Log DoH lookup failure
This commit is contained in:
1 parent
6a42793a59
commit
e4685c7018
1 file changed
+5
-1
@@ -41,6 +41,7 @@ private fun buildDoHDNS(url: String): DnsOverHttps {
|
||||
return DnsOverHttps.Builder().apply {
|
||||
client(EhApplication.okHttpClient)
|
||||
url(url.toHttpUrl())
|
||||
post(true)
|
||||
systemDns(systemDns)
|
||||
}.build()
|
||||
}
|
||||
@@ -48,5 +49,8 @@ private fun buildDoHDNS(url: String): DnsOverHttps {
|
||||
private var doh: DnsOverHttps? = Settings.dohUrl.runCatching { buildDoHDNS(this) }.getOrNull()
|
||||
|
||||
object EhDoH {
|
||||
fun lookup(hostname: String): List<InetAddress>? = doh?.runCatching { lookup(hostname).takeIf { it.isNotEmpty() } }?.getOrNull()
|
||||
fun lookup(hostname: String): List<InetAddress>? = doh
|
||||
?.runCatching { lookup(hostname).takeIf { it.isNotEmpty() } }
|
||||
?.onFailure { it.printStackTrace() }
|
||||
?.getOrNull()
|
||||
}
|
||||
Reference in new issue
Block a user