diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-09-13 01:09:09 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-09-13 01:09:09 +0100 |
commit | 5edc7624cee30676fc91be2759ca5a9bc31e54ee (patch) | |
tree | 87e3ae2847f341ade21e13663f2577826dd5b4a1 /src/cfg_rcl.c | |
parent | 29c04315424483ba6d033d1811254528c94e9ec5 (diff) | |
download | rspamd-5edc7624cee30676fc91be2759ca5a9bc31e54ee.tar.gz rspamd-5edc7624cee30676fc91be2759ca5a9bc31e54ee.zip |
Refactor metric actions handling.
Use array of actions instead of a linked list to speed up processing.
* Removed required_score, reject_score and action in metric config,
now REJECT is the only default action for a metric.
Diffstat (limited to 'src/cfg_rcl.c')
-rw-r--r-- | src/cfg_rcl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cfg_rcl.c b/src/cfg_rcl.c index b6a08657a..243d1437e 100644 --- a/src/cfg_rcl.c +++ b/src/cfg_rcl.c @@ -328,10 +328,9 @@ rspamd_rcl_metric_handler (struct config_file *cfg, rspamd_cl_object_t *obj, g_set_error (err, CFG_RCL_ERROR, EINVAL, "invalid action definition: %s", cur->key); return FALSE; } - action = memory_pool_alloc (cfg->cfg_pool, sizeof (struct metric_action)); + action = &metric->actions[action_value]; action->action = action_value; action->score = action_score; - metric->actions = g_list_prepend (metric->actions, action); } } else if (new) { |