diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-21 03:47:28 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-21 03:47:28 +0400 |
commit | d0dbd1aa3a95c5a1f354458033f6af2b8f01a4a5 (patch) | |
tree | 8eeb5071c8ddfd02a16656cc94a1e69892324b1e /src/plugins/regexp.c | |
parent | 91cbed7c0143bd581f0034c57ea00da479412784 (diff) | |
download | rspamd-d0dbd1aa3a95c5a1f354458033f6af2b8f01a4a5.tar.gz rspamd-d0dbd1aa3a95c5a1f354458033f6af2b8f01a4a5.zip |
* Add raw mode flag for improving performance by avoiding expensive utf8 transforms
* Improve FreeBSD start script by adding config test precmd
Diffstat (limited to 'src/plugins/regexp.c')
-rw-r--r-- | src/plugins/regexp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 27278b3c8..6af883943 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -78,7 +78,7 @@ regexp_module_init (struct config_file *cfg, struct module_ctx **ctx) } static gboolean -read_regexp_expression (memory_pool_t *pool, struct regexp_module_item *chain, char *symbol, char *line) +read_regexp_expression (memory_pool_t *pool, struct regexp_module_item *chain, char *symbol, char *line, struct config_file *cfg) { struct expression *e, *cur; @@ -91,7 +91,7 @@ read_regexp_expression (memory_pool_t *pool, struct regexp_module_item *chain, c cur = e; while (cur) { if (cur->type == EXPR_REGEXP) { - cur->content.operand = parse_regexp (pool, cur->content.operand); + cur->content.operand = parse_regexp (pool, cur->content.operand, cfg->raw_mode); if (cur->content.operand == NULL) { msg_warn ("read_regexp_expression: cannot parse regexp, skip expression %s = \"%s\"", symbol, line); return FALSE; @@ -132,7 +132,7 @@ regexp_module_config (struct config_file *cfg) } cur_item = memory_pool_alloc0 (regexp_module_ctx->regexp_pool, sizeof (struct regexp_module_item)); cur_item->symbol = cur->param; - if (!read_regexp_expression (regexp_module_ctx->regexp_pool, cur_item, cur->param, cur->value)) { + if (!read_regexp_expression (regexp_module_ctx->regexp_pool, cur_item, cur->param, cur->value, cfg)) { res = FALSE; } regexp_module_ctx->items = g_list_prepend (regexp_module_ctx->items, cur_item); @@ -449,7 +449,7 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args) } /* This is regexp, so compile and create g_regexp object */ if ((re = re_cache_check (param_pattern)) == NULL) { - re = parse_regexp (task->task_pool, param_pattern); + re = parse_regexp (task->task_pool, param_pattern, task->cfg->raw_mode); if (re == NULL) { msg_warn ("rspamd_regexp_match_number: cannot compile regexp for function"); return FALSE; |