From 3e3b3d18a4c4f4a182e1c4b45b34612ae9ec0332 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 May 2008 18:36:42 +0000 Subject: 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 --- src/users.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 82d11eb34..60d0f65eb 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -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()) { -- cgit v1.2.3