Commit fb0dbafb authored by Mygod's avatar Mygod

Suppress local DNS resolve timeout exceptions

parent 3c7d045c
...@@ -44,9 +44,11 @@ class LocalDnsWorker(private val resolver: suspend (ByteArray) -> ByteArray) : C ...@@ -44,9 +44,11 @@ class LocalDnsWorker(private val resolver: suspend (ByteArray) -> ByteArray) : C
byteArrayOf() // return empty if cannot parse packet byteArrayOf() // return empty if cannot parse packet
} }
}?.let { response -> }?.let { response ->
try {
val output = DataOutputStream(socket.outputStream) val output = DataOutputStream(socket.outputStream)
output.writeShort(response.size) output.writeShort(response.size)
output.write(response) output.write(response)
} catch (_: IOException) { } // connection early close possibly due to resolving timeout
} }
} }
} }
......
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