check for GetDisabled should be before the match() commands, because its not worth wasting cpu time on match if its disabled anyway

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9741 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2008-05-18 18:36:42 +00:00
parent a14e9ff3d1
commit 3e3b3d18a4

View File

@ -1715,7 +1715,7 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
}
else
{
ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Total classes: %d", ServerInstance->Config->Classes.size());
ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Total classes: %lu", ServerInstance->Config->Classes.size());
for (ClassVector::iterator i = ServerInstance->Config->Classes.begin(); i != ServerInstance->Config->Classes.end(); i++)
{
@ -1730,6 +1730,13 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "DENY %s %d %s", c->GetHost().c_str(), c->GetPort(), c->GetName().c_str());
}
/* if it's disabled, we can't match this one. */
if (c->GetDisabled())
{
ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Class disabled");
continue;
}
/* check if host matches.. */
if (((!match(this->GetIPString(),c->GetHost(),true)) && (!match(this->host,c->GetHost()))))
{
@ -1747,13 +1754,6 @@ ConnectClass* User::SetClass(const std::string &explicit_name)
continue;
}
/* if it's disabled, we can't match this one. */
if (c->GetDisabled())
{
ServerInstance->Logs->Log("CONNECTCLASS", DEBUG, "Class disabled");
continue;
}
/* if it requires a port ... */
if (c->GetPort())
{