]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix plugins registration.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 27 May 2015 14:33:40 +0000 (15:33 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 27 May 2015 14:33:40 +0000 (15:33 +0100)
src/libserver/protocol.c
src/plugins/chartable.c
src/plugins/dkim_check.c
src/plugins/fuzzy_check.c
src/plugins/regexp.c
src/plugins/spf.c
src/plugins/surbl.c

index a0c824bc97e7a839bef52424bdfcfaf9e3ae7a72..f49535f378a5d18e4cea3d5ab85100beb33227a3 100644 (file)
 
 static GList *custom_commands = NULL;
 
- static gchar *
- rspamd_protocol_header_dup (struct rspamd_task *task, GString *h)
- {
-       gchar *res;
-
-       g_assert (h != NULL);
-       g_assert (h->len > 0);
-
-       res = rspamd_mempool_alloc (task->task_pool, h->len + 1);
-       rspamd_strlcpy (res, h->str, h->len + 1);
-
-       return res;
- }
-
 /*
  * Remove <> from the fixed string and copy it to the pool
  */
index 3efec040b59ec3cc72d3d330eef82d97b071b8c5..7c4372a13165b88bed5051d75d94c19d39b8cac8 100644 (file)
@@ -60,8 +60,6 @@ struct chartable_ctx {
 };
 
 static struct chartable_ctx *chartable_module_ctx = NULL;
-
-static gint chartable_mime_filter (struct rspamd_task *task);
 static void chartable_symbol_callback (struct rspamd_task *task, void *unused);
 
 gint
@@ -102,7 +100,7 @@ chartable_module_config (struct rspamd_config *cfg)
                chartable_module_ctx->threshold = DEFAULT_THRESHOLD;
        }
 
-       register_symbol (&cfg->cache,
+       register_symbol (cfg->cache,
                chartable_module_ctx->symbol,
                1,
                chartable_symbol_callback,
index 9e88ab3100c263b4dc612f414cc3a272af4675fc..7e430f5a66ab1b7b2fd402d631f687749229ec80 100644 (file)
@@ -223,15 +223,15 @@ dkim_module_config (struct rspamd_config *cfg)
                        "trusted_only option is set and no trusted domains are defined; disabling dkim module completely as it is useless in this case");
        }
        else {
-               register_symbol (&cfg->cache,
+               register_symbol (cfg->cache,
                        dkim_module_ctx->symbol_reject,
                        1,
                        dkim_symbol_callback,
                        NULL);
-               register_virtual_symbol (&cfg->cache,
+               register_virtual_symbol (cfg->cache,
                        dkim_module_ctx->symbol_tempfail,
                        1);
-               register_virtual_symbol (&cfg->cache,
+               register_virtual_symbol (cfg->cache,
                        dkim_module_ctx->symbol_allow,
                        1);
 
index ebaab2717245310eec926772d1dbe7fc13c7cafd..c1556fa4dd65a4c0afd01965b851ef794ffb400f 100644 (file)
@@ -174,7 +174,7 @@ parse_flags (struct fuzzy_rule *rule,
                                /* Add flag to hash table */
                                g_hash_table_insert (rule->mappings,
                                        GINT_TO_POINTER (map->fuzzy_flag), map);
-                               register_virtual_symbol (&cfg->cache, map->symbol, 1.0);
+                               register_virtual_symbol (cfg->cache, map->symbol, 1.0);
                        }
                        else {
                                msg_err ("fuzzy_map parameter has no flag definition");
@@ -383,7 +383,7 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj)
                        fuzzy_module_ctx->fuzzy_rules,
                        rule);
                if (rule->symbol != fuzzy_module_ctx->default_symbol) {
-                       register_virtual_symbol (&cfg->cache, rule->symbol, 1.0);
+                       register_virtual_symbol (cfg->cache, rule->symbol, 1.0);
                }
        }
 
@@ -484,7 +484,7 @@ fuzzy_check_module_config (struct rspamd_config *cfg)
        }
 
        if (fuzzy_module_ctx->fuzzy_rules != NULL) {
-               register_callback_symbol (&cfg->cache, fuzzy_module_ctx->default_symbol,
+               register_callback_symbol (cfg->cache, fuzzy_module_ctx->default_symbol,
                        1.0, fuzzy_symbol_callback, NULL);
        }
        else {
index 8df81a9e6cdd56ccf2362d5d17a89baa9d5781ae..2a9229b090efa9e8e119dba8d95020fd3e1f6fa7 100644 (file)
@@ -142,7 +142,7 @@ regexp_module_config (struct rspamd_config *cfg)
                                res = FALSE;
                        }
                        else {
-                               register_symbol (&cfg->cache,
+                               register_symbol (cfg->cache,
                                                cur_item->symbol,
                                                1,
                                                process_regexp_item,
@@ -154,7 +154,7 @@ regexp_module_config (struct rspamd_config *cfg)
                                        sizeof (struct regexp_module_item));
                        cur_item->symbol = ucl_object_key (value);
                        cur_item->lua_function = ucl_object_toclosure (value);
-                       register_symbol (&cfg->cache,
+                       register_symbol (cfg->cache,
                                cur_item->symbol,
                                1,
                                process_regexp_item,
index 8e03334fbe3548c9cf5387f8d8ac1c69ce9f0fa9..f3c8226e40e50a866313eb6615c1da2054b3f26a 100644 (file)
@@ -151,14 +151,14 @@ spf_module_config (struct rspamd_config *cfg)
                }
        }
 
-       register_symbol (&cfg->cache,
+       register_symbol (cfg->cache,
                spf_module_ctx->symbol_fail,
                1,
                spf_symbol_callback,
                NULL);
-       register_virtual_symbol (&cfg->cache, spf_module_ctx->symbol_softfail, 1);
-       register_virtual_symbol (&cfg->cache, spf_module_ctx->symbol_neutral,  1);
-       register_virtual_symbol (&cfg->cache, spf_module_ctx->symbol_allow,        1);
+       register_virtual_symbol (cfg->cache, spf_module_ctx->symbol_softfail, 1);
+       register_virtual_symbol (cfg->cache, spf_module_ctx->symbol_neutral,  1);
+       register_virtual_symbol (cfg->cache, spf_module_ctx->symbol_allow,         1);
 
        spf_module_ctx->spf_hash = rspamd_lru_hash_new (
                        cache_size,
index 39a6e29745299f8a73bc89ba6f0761991347dbf0..bd87dc944f003d4f38594a062abaf752cce66154 100644 (file)
@@ -314,18 +314,18 @@ register_bit_symbols (struct rspamd_config *cfg, struct suffix_item *suffix)
 
                while (g_hash_table_iter_next (&it, &k, &v)) {
                        bit = v;
-                       register_virtual_symbol (&cfg->cache, bit->symbol, 1);
+                       register_virtual_symbol (cfg->cache, bit->symbol, 1);
                        msg_debug ("bit: %d", bit->bit);
                }
        }
        else if (suffix->bits != NULL) {
                for (i = 0; i < suffix->bits->len; i++) {
                        bit = &g_array_index (suffix->bits, struct surbl_bit_item, i);
-                       register_virtual_symbol (&cfg->cache, bit->symbol, 1);
+                       register_virtual_symbol (cfg->cache, bit->symbol, 1);
                }
        }
        else {
-               register_virtual_symbol (&cfg->cache, suffix->symbol, 1);
+               register_virtual_symbol (cfg->cache, suffix->symbol, 1);
        }
 }
 
@@ -361,7 +361,7 @@ surbl_module_config (struct rspamd_config *cfg)
                rspamd_config_get_module_opt (cfg, "surbl",
                "redirector_symbol")) != NULL) {
                surbl_module_ctx->redirector_symbol = ucl_obj_tostring (value);
-               register_virtual_symbol (&cfg->cache,
+               register_virtual_symbol (cfg->cache,
                        surbl_module_ctx->redirector_symbol,
                        1.0);
        }
@@ -553,7 +553,7 @@ surbl_module_config (struct rspamd_config *cfg)
                        surbl_module_ctx->suffixes = g_list_prepend (
                                surbl_module_ctx->suffixes,
                                new_suffix);
-                       register_callback_symbol (&cfg->cache,
+                       register_callback_symbol (cfg->cache,
                                new_suffix->symbol,
                                1,
                                surbl_test_url,