1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 10:53:13 +02:00

Major TKL speed improvements.

This commit is contained in:
Bram Matthys
2019-03-03 20:25:05 +01:00
parent 87c81e7e9f
commit fac1e30b91
6 changed files with 578 additions and 340 deletions
+1
View File
@@ -684,6 +684,7 @@ extern char *md5hash(unsigned char *dst, const unsigned char *src, unsigned long
extern MODVAR char langsinuse[4096];
extern MODVAR char *casemapping[2];
extern MODVAR aTKline *tklines[TKLISTLEN];
extern MODVAR aTKline *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
extern char *cmdname_by_spamftarget(int target);
extern void unrealdns_delreq_bycptr(aClient *cptr);
extern void sendtxtnumeric(aClient *to, char *pattern, ...) __attribute__((format(printf,2,3)));
+3 -1
View File
@@ -1798,7 +1798,9 @@ struct _maxtargets {
#define BANCHK_MSG 1 /* checking if a ban forbids the person from sending messages */
#define BANCHK_NICK 2 /* checking if a ban forbids the person from changing his/her nick */
#define TKLISTLEN 26
#define TKLISTLEN 26
#define TKLIPHASHLEN1 4
#define TKLIPHASHLEN2 1021
#define MATCH_CHECK_IP 0x0001
#define MATCH_CHECK_REAL_HOST 0x0002
-1
View File
@@ -1346,7 +1346,6 @@ int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, cha
RunHookReturnInt2(HOOKTYPE_REQUIRE_SASL, sptr, bconf->reason, !=0);
return banned_client(sptr, "Require-Auth", bconf->reason?bconf->reason:"", 0, 0);
}
tkl_check_expire(NULL);
/* Check G/Z lines before shuns -- kill before quite -- codemastr */
if ((xx = find_tkline_match(sptr, 0)) < 0)
{
+568 -332
View File
File diff suppressed because it is too large Load Diff
+4 -6
View File
@@ -2252,18 +2252,16 @@ void config_rehash()
/* Clean up local spamfilter entries... */
for (tk = tklines[tkl_hash('f')]; tk; tk = tk_next)
{
tk_next = tk->next;
if (tk->type == TKL_SPAMF)
tk_next = tkl_del_line(tk);
else /* global spamfilter.. don't touch! */
tk_next = tk->next;
tkl_del_line(tk);
}
for (tk = tklines[tkl_hash('q')]; tk; tk = tk_next)
{
tk_next = tk->next;
if (tk->type == TKL_NICK)
tk_next = tkl_del_line(tk);
else
tk_next = tk->next;
tkl_del_line(tk);
}
for (deny_dcc_ptr = conf_deny_dcc; deny_dcc_ptr; deny_dcc_ptr = (ConfigItem_deny_dcc *)next)
+2
View File
@@ -41,9 +41,11 @@
#include "inet.h"
MODVAR aTKline *tklines[TKLISTLEN];
MODVAR aTKline *tklines_ip_hash[TKLIPHASHLEN1][TKLIPHASHLEN2];
int MODVAR spamf_ugly_vchanoverride = 0;
void tkl_init(void)
{
memset(tklines, 0, sizeof(tklines));
memset(tklines_ip_hash, 0, sizeof(tklines_ip_hash));
}