code polish to more straightforward logic
This commit is contained in:
parent
7d67cc86b7
commit
64a36cb4f8
|
@ -137,11 +137,6 @@ internal class ServerHandshake<CONNECTION : Connection>(private val logger: KLog
|
|||
clientAddressString: String,
|
||||
clientAddress: InetAddress): Boolean {
|
||||
|
||||
if (clientAddress.isLoopbackAddress) {
|
||||
// we do not want to limit loopback addresses
|
||||
return true
|
||||
}
|
||||
|
||||
try {
|
||||
// VALIDATE:: Check to see if there are already too many clients connected.
|
||||
if (server.connections.connectionCount() >= config.maxClientCount) {
|
||||
|
@ -357,7 +352,9 @@ internal class ServerHandshake<CONNECTION : Connection>(private val logger: KLog
|
|||
return
|
||||
}
|
||||
|
||||
if (!validateUdpConnectionInfo(server, handshakePublication, config, clientAddressString, clientAddress)) {
|
||||
if (!clientAddress.isLoopbackAddress &&
|
||||
!validateUdpConnectionInfo(server, handshakePublication, config, clientAddressString, clientAddress)) {
|
||||
// we do not want to limit loopback addresses!
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue