mirror of https://github.com/OpenTTD/OpenTTD
(svn r22085) -Fix: assert when connecting to the admin port
parent
949bfabe5e
commit
d2d6b263b3
|
@ -81,7 +81,12 @@ ServerNetworkAdminSocketHandler::~ServerNetworkAdminSocketHandler()
|
||||||
*/
|
*/
|
||||||
/* static */ bool ServerNetworkAdminSocketHandler::AllowConnection()
|
/* static */ bool ServerNetworkAdminSocketHandler::AllowConnection()
|
||||||
{
|
{
|
||||||
return !StrEmpty(_settings_client.network.admin_password) && _network_admins_connected < MAX_ADMINS;
|
bool accept = !StrEmpty(_settings_client.network.admin_password) && _network_admins_connected < MAX_ADMINS;
|
||||||
|
/* We can't go over the MAX_ADMINS limit here. However, if we accept
|
||||||
|
* the connection, there has to be space in the pool. */
|
||||||
|
assert_compile(NetworkAdminSocketPool::MAX_SIZE == MAX_ADMINS);
|
||||||
|
assert(!accept || ServerNetworkAdminSocketHandler::CanAllocateItem());
|
||||||
|
return accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Send the packets for the server sockets. */
|
/** Send the packets for the server sockets. */
|
||||||
|
|
Loading…
Reference in New Issue