Commit 9894d0e9 authored by Mygod's avatar Mygod

Fix proxies timeout not thrown

parent f4e65b2e
...@@ -60,14 +60,14 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro ...@@ -60,14 +60,14 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
conn.doOutput = true conn.doOutput = true
val proxies = try { val proxies = try {
withTimeout(30_000) { withTimeoutOrNull(30_000) {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
conn.outputStream.bufferedWriter().use { conn.outputStream.bufferedWriter().use {
it.write("sig=" + Base64.encodeToString(mdg.digest(), Base64.DEFAULT)) it.write("sig=" + Base64.encodeToString(mdg.digest(), Base64.DEFAULT))
} }
conn.inputStream.bufferedReader().readText() conn.inputStream.bufferedReader().readText()
} }
} } ?: throw UnknownHostException()
} finally { } finally {
conn.disconnectFromMain() conn.disconnectFromMain()
}.split('|').toMutableList() }.split('|').toMutableList()
......
Markdown is supported
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