Fix: UnknownHostException in cinterop command. (#2271)
This commit is contained in:
@@ -289,17 +289,15 @@ internal object InternalServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkAccessible(): Boolean {
|
private fun checkAccessible() = try {
|
||||||
if (!InetAddress.getLocalHost().canonicalHostName.endsWith(".$internalDomain")) {
|
if (!InetAddress.getLocalHost().canonicalHostName.endsWith(".$internalDomain")) {
|
||||||
// Fast path:
|
// Fast path:
|
||||||
return false
|
false
|
||||||
}
|
} else {
|
||||||
|
|
||||||
try {
|
|
||||||
InetAddress.getByName(host)
|
InetAddress.getByName(host)
|
||||||
return true
|
true
|
||||||
} catch (e: UnknownHostException) {
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
} catch (e: UnknownHostException) {
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user