diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-09 18:19:26 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-09 18:19:26 +0000 |
commit | a30d6a8b27946bbcd03c8b18ec46a7129363af83 (patch) | |
tree | b210f4c200232cf90aefd642a3a36cb6d0678cc7 /src/libserver/re_cache.c | |
parent | bba8973b4af2ee14b0007e97337bf9e6ff34ae1a (diff) | |
download | rspamd-a30d6a8b27946bbcd03c8b18ec46a7129363af83.tar.gz rspamd-a30d6a8b27946bbcd03c8b18ec46a7129363af83.zip |
Include maxhits in re hash
Diffstat (limited to 'src/libserver/re_cache.c')
-rw-r--r-- | src/libserver/re_cache.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index da25040f8..5b6eb67f6 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -333,6 +333,11 @@ rspamd_re_cache_init (struct rspamd_re_cache *cache) sizeof (fl)); rspamd_cryptobox_hash_update (&st_global, (const guchar *) &fl, sizeof (fl)); + fl = rspamd_regexp_get_maxhits (re); + rspamd_cryptobox_hash_update (re_class->st, (const guchar *) &fl, + sizeof (fl)); + rspamd_cryptobox_hash_update (&st_global, (const guchar *) &fl, + sizeof (fl)); } /* Now finalize all classes */ @@ -472,7 +477,6 @@ rspamd_re_cache_hyperscan_cb (unsigned int id, cbdata->in + from, to - from, FALSE); - msg_info ("pcre: %s", rspamd_regexp_get_pattern (pcre_elt->re)); } setbit (rt->checked, id); @@ -580,10 +584,14 @@ rspamd_re_cache_exec_re (struct rspamd_task *task, gboolean raw = FALSE; struct mime_text_part *part; struct rspamd_url *url; - + struct rspamd_re_cache *cache = rt->cache; gpointer k, v; gsize len; + msg_debug_re_cache ("get to the slow path for re type: %s: %s", + rspamd_re_cache_type_to_string (re_class->type), + rspamd_regexp_get_pattern (re)); + switch (re_class->type) { case RSPAMD_RE_HEADER: case RSPAMD_RE_RAWHEADER: |