]> source.dussan.org Git - rspamd.git/commitdiff
Add some human readable aliases for rspamd configuration options.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2015 17:40:50 +0000 (18:40 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 May 2015 17:40:50 +0000 (18:40 +0100)
src/libserver/cfg_rcl.c

index 5869bd6fb04931b4969bb8309e7eff3912c61f71..7c898431fe1ef3dca7329a2f5c287595d5a0826d 100644 (file)
@@ -631,6 +631,10 @@ rspamd_rcl_worker_handler (rspamd_mempool_t *pool, const ucl_object_t *obj,
        }
 
        val = ucl_object_find_key (obj, "bind_socket");
+       /* This name is more logical */
+       if (val == NULL) {
+               val = ucl_object_find_key (obj, "listen");
+       }
        if (val != NULL) {
                it = ucl_object_iterate_new (val);
                while ((cur = ucl_object_iterate_safe (it, true)) != NULL) {
@@ -1270,6 +1274,11 @@ rspamd_rcl_config_init (void)
                rspamd_rcl_parse_struct_string_list,
                G_STRUCT_OFFSET (struct rspamd_config, nameservers),
                0);
+       rspamd_rcl_add_default_handler (ssub,
+               "server",
+               rspamd_rcl_parse_struct_string_list,
+               G_STRUCT_OFFSET (struct rspamd_config, nameservers),
+               0);
        rspamd_rcl_add_default_handler (ssub,
                "timeout",
                rspamd_rcl_parse_struct_time,
@@ -1285,6 +1294,11 @@ rspamd_rcl_config_init (void)
                rspamd_rcl_parse_struct_integer,
                G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server),
                RSPAMD_CL_FLAG_INT_32);
+       rspamd_rcl_add_default_handler (ssub,
+               "connections",
+               rspamd_rcl_parse_struct_integer,
+               G_STRUCT_OFFSET (struct rspamd_config, dns_io_per_server),
+               RSPAMD_CL_FLAG_INT_32);
 
        /* New upstreams configuration */
        ssub = rspamd_rcl_add_section (&sub->subsections, "upstream", NULL,
@@ -1373,6 +1387,11 @@ rspamd_rcl_config_init (void)
                rspamd_rcl_parse_struct_boolean,
                G_STRUCT_OFFSET (struct rspamd_config, check_all_filters),
                0);
+       rspamd_rcl_add_default_handler (sub,
+               "all_filters",
+               rspamd_rcl_parse_struct_boolean,
+               G_STRUCT_OFFSET (struct rspamd_config, check_all_filters),
+               0);
        rspamd_rcl_add_default_handler (sub,
                "min_word_len",
                rspamd_rcl_parse_struct_integer,
@@ -1383,6 +1402,11 @@ rspamd_rcl_config_init (void)
                rspamd_rcl_parse_struct_string,
                G_STRUCT_OFFSET (struct rspamd_config, tld_file),
                RSPAMD_CL_FLAG_STRING_PATH);
+       rspamd_rcl_add_default_handler (sub,
+               "tld",
+               rspamd_rcl_parse_struct_string,
+               G_STRUCT_OFFSET (struct rspamd_config, tld_file),
+               RSPAMD_CL_FLAG_STRING_PATH);
 
        /**
         * Metric section