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,
|
clientAddressString: String,
|
||||||
clientAddress: InetAddress): Boolean {
|
clientAddress: InetAddress): Boolean {
|
||||||
|
|
||||||
if (clientAddress.isLoopbackAddress) {
|
|
||||||
// we do not want to limit loopback addresses
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// VALIDATE:: Check to see if there are already too many clients connected.
|
// VALIDATE:: Check to see if there are already too many clients connected.
|
||||||
if (server.connections.connectionCount() >= config.maxClientCount) {
|
if (server.connections.connectionCount() >= config.maxClientCount) {
|
||||||
|
@ -357,7 +352,9 @@ internal class ServerHandshake<CONNECTION : Connection>(private val logger: KLog
|
||||||
return
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user