summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-18 18:36:42 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-18 18:36:42 +0000
commit3e3b3d18a4c4f4a182e1c4b45b34612ae9ec0332 (patch)
tree56ec01b6ce6e346dbe23f5086af0cf4f8d8fc36f
parenta14e9ff3d194001952c2ed9a296c88840908bb46 (diff)
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
-rw-r--r--src/users.cpp16
1 files changed, 8 insertions, 8 deletions
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())
{