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
byteArrayOf() // return empty if cannot parse packet
}
}?.let { response ->
val output = DataOutputStream(socket.outputStream)
output.writeShort(response.size)
output.write(response)
try {
val output = DataOutputStream(socket.outputStream)
output.writeShort(response.size)
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