summaryrefslogtreecommitdiff
path: root/src/modules/m_connflood.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-21 23:22:04 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-21 23:22:04 +0000
commit06fd57cc35c9d5869ca3a24d349b791963b2acc4 (patch)
tree14a968c830b6941dd766e9d3ddd71435e82e9e24 /src/modules/m_connflood.cpp
parent97cf2d2384e255d8e77af7b70fdc057461b83c38 (diff)
fix for bug #175, change OnUserRegister to return int, and if greater than 0 = user was quit and stop propagating to rest of loaded modules. Also bumb the module API version.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5783 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_connflood.cpp')
-rw-r--r--src/modules/m_connflood.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp
index 585891f74..a226fa189 100644
--- a/src/modules/m_connflood.cpp
+++ b/src/modules/m_connflood.cpp
@@ -74,7 +74,7 @@ public:
first = ServerInstance->Time();
}
- virtual void OnUserRegister(userrec* user)
+ virtual int OnUserRegister(userrec* user)
{
time_t next = ServerInstance->Time();
if (!first)
@@ -93,10 +93,10 @@ public:
/* expire throttle */
throttled = 0;
ServerInstance->WriteOpers("*** Connection throttle deactivated");
- return;
+ return 0;
}
userrec::QuitUser(ServerInstance, user, quitmsg);
- return;
+ return 1;
}
if (tdiff <= seconds)
@@ -106,7 +106,7 @@ public:
throttled = 1;
ServerInstance->WriteOpers("*** Connection throttle activated");
userrec::QuitUser(ServerInstance, user, quitmsg);
- return;
+ return 1;
}
}
else
@@ -114,6 +114,7 @@ public:
conns = 1;
first = next;
}
+ return 0;
}
virtual void OnRehash(const std::string &parameter)