]> source.dussan.org Git - rspamd.git/commitdiff
Fix symbols items loading.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 4 Jun 2015 17:19:10 +0000 (18:19 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 4 Jun 2015 17:19:10 +0000 (18:19 +0100)
src/libserver/symbols_cache.c

index 8d5ec0f3c56edb1ccd5532d8aa54ca996dc05951..db0704e9369434289a674563a0543b6e7c57087a 100644 (file)
@@ -265,30 +265,30 @@ rspamd_symbols_cache_load_items (struct symbols_cache *cache, const gchar *name)
                        if (elt) {
                                item->frequency = ucl_object_toint (elt);
                        }
-               }
-       }
 
-       if (item->type == SYMBOL_TYPE_VIRTUAL && item->parent != -1) {
-               g_assert (item->parent < (gint)cache->items_by_order->len);
-               parent = g_ptr_array_index (cache->items_by_order, item->parent);
+                       if (item->type == SYMBOL_TYPE_VIRTUAL && item->parent != -1) {
+                               g_assert (item->parent < (gint)cache->items_by_order->len);
+                               parent = g_ptr_array_index (cache->items_by_order, item->parent);
 
-               if (parent->weight < item->weight) {
-                       parent->weight = item->weight;
-               }
+                               if (parent->weight < item->weight) {
+                                       parent->weight = item->weight;
+                               }
 
-               /*
-                * We maintain avg_time for virtual symbols equal to the
-                * parent item avg_time
-                */
-               parent->avg_time = item->avg_time;
-               parent->avg_counter = item->avg_counter;
-       }
+                               /*
+                                * We maintain avg_time for virtual symbols equal to the
+                                * parent item avg_time
+                                */
+                               parent->avg_time = item->avg_time;
+                               parent->avg_counter = item->avg_counter;
+                       }
 
-       if (abs (item->weight) > cache->max_weight) {
-               cache->max_weight = abs (item->weight);
-       }
+                       if (abs (item->weight) > cache->max_weight) {
+                               cache->max_weight = abs (item->weight);
+                       }
 
-       cache->total_freq += item->frequency;
+                       cache->total_freq += item->frequency;
+               }
+       }
 
        ucl_object_iterate_free (it);
        ucl_object_unref (top);