diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-19 19:25:13 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-19 19:25:13 +0000 |
commit | 7fca34c32a92915e85cf729f61b24e130753f556 (patch) | |
tree | 93ec86e60d7602ebdbdddfb6e069e1b2da751865 | |
parent | e6c75d3fea4d1646fae2cd05aee44ec101c877d1 (diff) |
- 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
-rw-r--r-- | modules/m_xline.c | 19 |
1 files changed, 18 insertions, 1 deletions
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 |