aboutsummaryrefslogtreecommitdiffstats
path: root/src/expressions.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-08-22 21:41:48 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-08-22 21:41:48 +0400
commitb90267a71cc8cdc8b38675322ef9fa7a9cb5468c (patch)
tree3bff8af523d19ec9cff93134b067fc404795000d /src/expressions.c
parented224e6a3530f54b5993e39066a8397d54e9517e (diff)
downloadrspamd-b90267a71cc8cdc8b38675322ef9fa7a9cb5468c.tar.gz
rspamd-b90267a71cc8cdc8b38675322ef9fa7a9cb5468c.zip
* Rework thread pools locking logic to avoid global lua mutex usage.
Fixed several memory leaks with modern glib. Fixed memory leak in dkim code. Fixed a problem with static global variables in shared libraries.
Diffstat (limited to 'src/expressions.c')
-rw-r--r--src/expressions.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/expressions.c b/src/expressions.c
index f552a5a77..fd94ed895 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -785,7 +785,7 @@ parse_regexp (memory_pool_t * pool, gchar *line, gboolean raw_mode)
}
gboolean
-call_expression_function (struct expression_function * func, struct worker_task * task)
+call_expression_function (struct expression_function * func, struct worker_task * task, lua_State *L)
{
struct _fl *selected, key;
@@ -794,17 +794,7 @@ call_expression_function (struct expression_function * func, struct worker_task
selected = bsearch (&key, list_ptr, functions_number, sizeof (struct _fl), fl_cmp);
if (selected == NULL) {
/* Try to check lua function */
-#if 0
- if (! lua_call_expression_func (NULL, func->name, task, func->args, &res)) {
- msg_warn ("call to undefined function %s", key.name);
- return FALSE;
- }
- else {
- return res;
- }
-#else
return FALSE;
-#endif
}
return selected->func (task, func->args, selected->user_data);
@@ -830,7 +820,7 @@ get_function_arg (struct expression *expr, struct worker_task *task, gboolean wa
}
else if (expr->type == EXPR_FUNCTION && !want_string) {
res->type = EXPRESSION_ARGUMENT_BOOL;
- cur = call_expression_function (expr->content.operand, task);
+ cur = call_expression_function (expr->content.operand, task, NULL);
res->data = GSIZE_TO_POINTER (cur);
}
else {
@@ -853,7 +843,7 @@ get_function_arg (struct expression *expr, struct worker_task *task, gboolean wa
return res;
}
else if (it->type == EXPR_FUNCTION) {
- cur = (gsize) call_expression_function ((struct expression_function *)it->content.operand, task);
+ cur = (gsize) call_expression_function ((struct expression_function *)it->content.operand, task, NULL);
debug_task ("function %s returned %s", ((struct expression_function *)it->content.operand)->name, cur ? "true" : "false");
}
else if (it->type == EXPR_OPERATION) {