diff options
Diffstat (limited to 'src/libserver/symbols_cache.c')
-rw-r--r-- | src/libserver/symbols_cache.c | 10 |
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; |