]> source.dussan.org Git - rspamd.git/commitdiff
Comvert composites to UCL properly.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Nov 2013 22:09:18 +0000 (22:09 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Nov 2013 22:09:18 +0000 (22:09 +0000)
src/cfg_xml.c

index 47ab8aca3a1ded054ea7e359166fef8ba0495ff2..e301696d350ec8e8f6dee5ec6507fd4997213764 100644 (file)
@@ -921,6 +921,16 @@ rspamd_xml_start_element (GMarkupParseContext *context, const gchar *element_nam
                                        ud->parent_pointer[0] = obj;
                                        ud->nested ++;
                                }
+                               else if (g_ascii_strcasecmp (element_name, "composite") == 0) {
+                                       /* Composite is 'special' tag */
+                                       obj = ucl_object_new ();
+                                       obj->type = UCL_OBJECT;
+                                       ud->parent_pointer[0] = obj;
+                                       ud->cfg->rcl_obj = ucl_object_insert_key (ud->cfg->rcl_obj, obj, element_name, 0, true);
+                                       process_attrs (attribute_names, attribute_values, obj);
+                                       ud->nested ++;
+                                       rspamd_strlcpy (ud->section_name[ud->nested], "expression", MAX_NAME);
+                               }
                                else if (g_ascii_strcasecmp (element_name, "module") == 0 &&
                                                extract_attr ("name", attribute_names, attribute_values, &res)) {
                                        obj = ucl_object_new ();