summaryrefslogtreecommitdiffstats
path: root/src/libserver/symbols_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-10-09 01:08:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-10-09 01:08:58 +0100
commitaeb484cac64fbdc876f0e1a58efa1490cdf029f5 (patch)
treebeebd3bf93f17d461e813605cb4b4fb6dac92f17 /src/libserver/symbols_cache.c
parentf1979c2e4d51a0114b0716203090171d6c92b82c (diff)
downloadrspamd-aeb484cac64fbdc876f0e1a58efa1490cdf029f5.tar.gz
rspamd-aeb484cac64fbdc876f0e1a58efa1490cdf029f5.zip
Place symbol definition in metric->symbols hash.
Diffstat (limited to 'src/libserver/symbols_cache.c')
-rw-r--r--src/libserver/symbols_cache.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c
index 6b24f3935..f40847bd3 100644
--- a/src/libserver/symbols_cache.c
+++ b/src/libserver/symbols_cache.c
@@ -315,7 +315,7 @@ register_symbol_common (struct symbols_cache **cache,
struct symbols_cache *pcache = *cache;
GList **target, *cur;
struct metric *m;
- double *w;
+ struct rspamd_symbol_def *s;
gboolean skipped;
if (*cache == NULL) {
@@ -355,10 +355,10 @@ register_symbol_common (struct symbols_cache **cache,
/* Handle weight using default metric */
if (pcache->cfg && pcache->cfg->default_metric &&
- (w =
+ (s =
g_hash_table_lookup (pcache->cfg->default_metric->symbols,
name)) != NULL) {
- item->s->weight = weight * (*w);
+ item->s->weight = weight * (*s->weight_ptr);
}
else {
item->s->weight = weight;
@@ -679,9 +679,11 @@ rspamd_symbols_cache_metric_cb (gpointer k, gpointer v, gpointer ud)
struct symbols_cache *cache = (struct symbols_cache *)ud;
GList *cur;
const gchar *sym = k;
- gdouble weight = *(gdouble *)v;
+ struct rspamd_symbol_def *s = (struct rspamd_symbol_def *)v;
+ gdouble weight;
struct cache_item *item;
+ weight = *s->weight_ptr;
cur = cache->negative_items;
while (cur) {
item = cur->data;