Commit 05d1303a authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Failed DoH requests are now logged

Implements #142
parent b499a094
...@@ -107,7 +107,7 @@ dependencies { ...@@ -107,7 +107,7 @@ dependencies {
implementation 'com.frostnerd.utilskt:preferences:1.5.14' // https://git.frostnerd.com/AndroidUtils/preferenceskt (Accessible after logging in [free of charge]) implementation 'com.frostnerd.utilskt:preferences:1.5.14' // https://git.frostnerd.com/AndroidUtils/preferenceskt (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:navigationdraweractivity:1.3.19' // https://git.frostnerd.com/AndroidUtils/navigationdraweractivity (Accessible after logging in [free of charge]) implementation 'com.frostnerd.utilskt:navigationdraweractivity:1.3.19' // https://git.frostnerd.com/AndroidUtils/navigationdraweractivity (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.5.134' // https://git.frostnerd.com/AndroidUtils/encrypteddnstunnelproxy implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.5.135' // https://git.frostnerd.com/AndroidUtils/encrypteddnstunnelproxy
implementation 'com.frostnerd.utilskt:general:1.0.16' // https://git.frostnerd.com/AndroidUtils/generalkt (Accessible after logging in [free of charge]) implementation 'com.frostnerd.utilskt:general:1.0.16' // https://git.frostnerd.com/AndroidUtils/generalkt (Accessible after logging in [free of charge])
implementation 'com.frostnerd.utilskt:adapters:1.1.1' // https://git.frostnerd.com/AndroidUtils/Adapters (Accessible after logging in [free of charge]) implementation 'com.frostnerd.utilskt:adapters:1.1.1' // https://git.frostnerd.com/AndroidUtils/Adapters (Accessible after logging in [free of charge])
......
...@@ -36,6 +36,7 @@ import com.frostnerd.smokescreen.util.proxy.ProxyBypassHandler ...@@ -36,6 +36,7 @@ import com.frostnerd.smokescreen.util.proxy.ProxyBypassHandler
import com.frostnerd.smokescreen.util.proxy.ProxyHttpsHandler import com.frostnerd.smokescreen.util.proxy.ProxyHttpsHandler
import com.frostnerd.smokescreen.util.proxy.ProxyTlsHandler import com.frostnerd.smokescreen.util.proxy.ProxyTlsHandler
import com.frostnerd.smokescreen.util.proxy.SmokeProxy import com.frostnerd.smokescreen.util.proxy.SmokeProxy
import com.frostnerd.vpntunnelproxy.FutureAnswer
import com.frostnerd.vpntunnelproxy.TrafficStats import com.frostnerd.vpntunnelproxy.TrafficStats
import com.frostnerd.vpntunnelproxy.VPNTunnelProxy import com.frostnerd.vpntunnelproxy.VPNTunnelProxy
import kotlinx.coroutines.* import kotlinx.coroutines.*
...@@ -783,6 +784,10 @@ class DnsVpnService : VpnService(), Runnable { ...@@ -783,6 +784,10 @@ class DnsVpnService : VpnService(), Runnable {
log("DnsProxy created, creating VPN proxy") log("DnsProxy created, creating VPN proxy")
vpnProxy = VPNTunnelProxy(dnsProxy!!, vpnService = this, coroutineScope = CoroutineScope( vpnProxy = VPNTunnelProxy(dnsProxy!!, vpnService = this, coroutineScope = CoroutineScope(
newFixedThreadPoolContext(2, "proxy-pool")), logger = object:com.frostnerd.vpntunnelproxy.Logger() { newFixedThreadPoolContext(2, "proxy-pool")), logger = object:com.frostnerd.vpntunnelproxy.Logger() {
override fun failedRequest(question: FutureAnswer, reason: Throwable?) {
if(reason != null) log("A request failed: " + Logger.stacktraceToString(reason), "VPN-LIBRARY")
}
val advancedLogging = getPreferences().advancedLogging val advancedLogging = getPreferences().advancedLogging
override fun logException(ex: Exception, terminal: Boolean, level: Level) { override fun logException(ex: Exception, terminal: Boolean, level: Level) {
if(terminal) log(ex) if(terminal) log(ex)
......
...@@ -59,7 +59,7 @@ class ProxyBypassHandler(private val searchDomains:List<String>, private val des ...@@ -59,7 +59,7 @@ class ProxyBypassHandler(private val searchDomains:List<String>, private val des
return true return true
} }
override fun informFailedRequest(request: FutureAnswer) { override fun informFailedRequest(request: FutureAnswer, failureReason:Throwable?) {
} }
override suspend fun modifyUpstreamResponse(dnsMessage: DnsMessage): DnsMessage { override suspend fun modifyUpstreamResponse(dnsMessage: DnsMessage): DnsMessage {
......
...@@ -64,7 +64,7 @@ class ProxyTlsHandler( ...@@ -64,7 +64,7 @@ class ProxyTlsHandler(
} ?: (resolveResult.firstOrNull() ?: throw IllegalStateException("The given UpstreamAddress doesn't have an address for the requested IP version (IPv4: $ipv4Enabled, IPv6: $ipv6Enabled)")) } ?: (resolveResult.firstOrNull() ?: throw IllegalStateException("The given UpstreamAddress doesn't have an address for the requested IP version (IPv4: $ipv4Enabled, IPv6: $ipv6Enabled)"))
} }
override fun informFailedRequest(request: FutureAnswer) { override fun informFailedRequest(request: FutureAnswer, failureReason:Throwable?) {
} }
override suspend fun modifyUpstreamResponse(dnsMessage: DnsMessage): DnsMessage { override suspend fun modifyUpstreamResponse(dnsMessage: DnsMessage): DnsMessage {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment