diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 09:59:52 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-16 09:59:52 +0000 |
commit | 6bc5286496c43a0ee9f1a616507c7aa03e28450c (patch) | |
tree | 9a6ed4374aaf129777560ba58f608368fb8754df /src/libserver/symbols_cache.c | |
parent | 153e64677902c1acc7a1e8ee21d5b634d8a65885 (diff) | |
download | rspamd-6bc5286496c43a0ee9f1a616507c7aa03e28450c.tar.gz rspamd-6bc5286496c43a0ee9f1a616507c7aa03e28450c.zip |
Refactor UCL API
Diffstat (limited to 'src/libserver/symbols_cache.c')
-rw-r--r-- | src/libserver/symbols_cache.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index b5facfce8..74176f695 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -391,7 +391,7 @@ rspamd_symbols_cache_load_items (struct symbols_cache *cache, const gchar *name) * metric */ #if 0 - elt = ucl_object_find_key (cur, "weight"); + elt = ucl_object_lookup (cur, "weight"); if (elt) { w = ucl_object_todouble (elt); @@ -400,17 +400,17 @@ rspamd_symbols_cache_load_items (struct symbols_cache *cache, const gchar *name) } } #endif - elt = ucl_object_find_key (cur, "time"); + elt = ucl_object_lookup (cur, "time"); if (elt) { item->avg_time = ucl_object_todouble (elt); } - elt = ucl_object_find_key (cur, "count"); + elt = ucl_object_lookup (cur, "count"); if (elt) { item->avg_counter = ucl_object_toint (elt); } - elt = ucl_object_find_key (cur, "frequency"); + elt = ucl_object_lookup (cur, "frequency"); if (elt) { item->frequency = ucl_object_toint (elt); } @@ -914,11 +914,11 @@ check_metric_settings (struct rspamd_task *task, struct metric *metric, return FALSE; } - mobj = ucl_object_find_key (task->settings, metric->name); + mobj = ucl_object_lookup (task->settings, metric->name); if (mobj != NULL) { - act = ucl_object_find_key (mobj, "actions"); + act = ucl_object_lookup (mobj, "actions"); if (act != NULL) { - reject = ucl_object_find_key (act, + reject = ucl_object_lookup (act, rspamd_action_to_str (METRIC_ACTION_REJECT)); if (reject != NULL && ucl_object_todouble_safe (reject, &val)) { *score = val; @@ -1198,7 +1198,7 @@ rspamd_symbols_cache_process_symbols (struct rspamd_task * task, if (task->settings) { const ucl_object_t *wl; - wl = ucl_object_find_key (task->settings, "whitelist"); + wl = ucl_object_lookup (task->settings, "whitelist"); if (wl != NULL) { msg_info_task ("<%s> is whitelisted", task->message_id); task->flags |= RSPAMD_TASK_FLAG_SKIP; |