aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/multipattern.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 15:17:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 15:17:24 +0100
commit4d1669e4b40e8a8e93ab652a60ed35ea64cf14da (patch)
tree7a703f756f47b774acc5e5f10781324dfbbca837 /src/libutil/multipattern.c
parenta5a312b65b3aa2539eeb483a04126f5f6a2b0014 (diff)
downloadrspamd-4d1669e4b40e8a8e93ab652a60ed35ea64cf14da.tar.gz
rspamd-4d1669e4b40e8a8e93ab652a60ed35ea64cf14da.zip
[Feature] Allow to have different flags for different patterns
Diffstat (limited to 'src/libutil/multipattern.c')
-rw-r--r--src/libutil/multipattern.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index d5e038654..f6a017047 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -384,7 +384,7 @@ rspamd_multipattern_create_sized (guint npatterns,
void
rspamd_multipattern_add_pattern (struct rspamd_multipattern *mp,
- const gchar *pattern)
+ const gchar *pattern, gint flags)
{
g_assert (pattern != NULL);
g_assert (mp != NULL);
@@ -402,14 +402,14 @@ rspamd_multipattern_add_pattern (struct rspamd_multipattern *mp,
}
g_array_append_val (mp->hs_flags, fl);
- np = rspamd_multipattern_pattern_filter (pattern, mp->flags);
+ np = rspamd_multipattern_pattern_filter (pattern, flags);
g_array_append_val (mp->hs_pats, np);
fl = mp->cnt;
g_array_append_val (mp->hs_ids, fl);
#else
ac_trie_pat_t pat;
- pat.ptr = rspamd_multipattern_pattern_filter (pattern, mp->flags);
+ pat.ptr = rspamd_multipattern_pattern_filter (pattern, flags);
pat.len = strlen (pat.ptr);
g_array_append_val (mp->pats, pat);
@@ -431,7 +431,7 @@ rspamd_multipattern_create_full (const gchar **patterns,
mp = rspamd_multipattern_create_sized (npatterns, flags);
for (i = 0; i < npatterns; i++) {
- rspamd_multipattern_add_pattern (mp, patterns[i]);
+ rspamd_multipattern_add_pattern (mp, patterns[i], flags);
}
return mp;