aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-28 23:04:59 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-28 23:04:59 +0000
commitdac3916ef0de04c3081bc8fef736fe1a84352eba (patch)
tree11d0f2d1e699b55920685492b8383bebb5de3260
parentb303477f7addbc15365aeae4d0cdeadf60fa21b1 (diff)
downloadrspamd-dac3916ef0de04c3081bc8fef736fe1a84352eba.tar.gz
rspamd-dac3916ef0de04c3081bc8fef736fe1a84352eba.zip
Use expressions process flags.
-rw-r--r--src/libmime/filter.c5
-rw-r--r--src/lua/lua_expression.c7
-rw-r--r--src/plugins/regexp.c2
3 files changed, 10 insertions, 4 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index 43e8e1b2d..d0fe7498e 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -478,7 +478,8 @@ rspamd_composite_expr_process (gpointer input, rspamd_expression_atom_t *atom)
/* Set checked for this symbol to avoid cyclic references */
if (isclr (cd->checked, ncomp->id * 2)) {
setbit (cd->checked, cd->composite->id * 2);
- rc = rspamd_process_expression (ncomp->expr, cd);
+ rc = rspamd_process_expression (ncomp->expr,
+ RSPAMD_EXPRESSION_FLAG_NOOPT, cd);
clrbit (cd->checked, cd->composite->id * 2);
ms = g_hash_table_lookup (cd->metric_res->symbols, sym);
}
@@ -557,7 +558,7 @@ composites_foreach_callback (gpointer key, gpointer value, void *data)
cd->composite = comp;
- rc = rspamd_process_expression (comp->expr, cd);
+ rc = rspamd_process_expression (comp->expr, RSPAMD_EXPRESSION_FLAG_NOOPT, cd);
/* Checked bit */
setbit (cd->checked, comp->id * 2);
diff --git a/src/lua/lua_expression.c b/src/lua/lua_expression.c
index b7e47c76a..2d7ceb734 100644
--- a/src/lua/lua_expression.c
+++ b/src/lua/lua_expression.c
@@ -174,8 +174,13 @@ lua_expr_process (lua_State *L)
{
struct lua_expression *e = rspamd_lua_expression (L, 1);
gint res;
+ gint flags = 0;
- res = rspamd_process_expression (e->expr, GINT_TO_POINTER (2));
+ if (lua_gettop (L) >= 3) {
+ flags = lua_tonumber (L, 3);
+ }
+
+ res = rspamd_process_expression (e->expr, flags, GINT_TO_POINTER (2));
lua_pushnumber (L, res);
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index c5f3203b3..f98f341a3 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -250,7 +250,7 @@ process_regexp_item (struct rspamd_task *task, void *user_data)
else {
/* Process expression */
if (item->expr) {
- res = rspamd_process_expression (item->expr, task);
+ res = rspamd_process_expression (item->expr, 0, task);
}
else {
msg_warn ("FIXME: %s symbol is broken with new expressions",