(svn r22085) -Fix: assert when connecting to the admin port

This commit is contained in:
smatz 2011-02-15 12:11:28 +00:00
parent 949bfabe5e
commit d2d6b263b3
1 changed files with 6 additions and 1 deletions

View File

@ -81,7 +81,12 @@ ServerNetworkAdminSocketHandler::~ServerNetworkAdminSocketHandler()
*/
/* 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. */