From 7fca34c32a92915e85cf729f61b24e130753f556 Mon Sep 17 00:00:00 2001 From: michael Date: Sun, 19 Jan 2014 19:25:13 +0000 Subject: - m_xline.c: speed up xline lookups git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2878 82007160-df01-0410-b94d-b575c5fd34c7 --- modules/m_xline.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/m_xline.c b/modules/m_xline.c index c10eb2a..a85b670 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -54,6 +54,23 @@ static int remove_xline_match(const char *); static void relay_xline(struct Client *, char *[]); +static void +check_xline(struct MaskItem *conf) +{ + dlink_node *ptr = NULL, *ptr_next = NULL; + + DLINK_FOREACH_SAFE(ptr, ptr_next, local_client_list.head) + { + struct Client *client_p = ptr->data; + + if (IsDead(client_p)) + continue; + + if (!match(conf->name, client_p->username)) + conf_try_ban(client_p, conf); + } +} + /* mo_xline() * * inputs - pointer to server @@ -361,7 +378,7 @@ write_xline(struct Client *source_p, char *gecos, char *reason, get_oper_name(source_p), conf->name, conf->reason); } - rehashed_klines = 1; + check_xline(conf); } static void -- cgit