diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/dkim_check.c | 8 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 26 | ||||
-rw-r--r-- | src/plugins/spf.c | 4 | ||||
-rw-r--r-- | src/plugins/surbl.c | 28 |
4 files changed, 33 insertions, 33 deletions
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index bc687065e..d09bddd54 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -155,8 +155,8 @@ dkim_module_config (struct rspamd_config *cfg) } if ((value = rspamd_config_get_module_opt (cfg, "dkim", "whitelist")) != NULL) { - if (!add_map (cfg, ucl_obj_tostring (value), - "DKIM whitelist", read_radix_list, fin_radix_list, + if (!rspamd_map_add (cfg, ucl_obj_tostring (value), + "DKIM whitelist", rspamd_radix_read, rspamd_radix_fin, (void **)&dkim_module_ctx->whitelist_ip)) { radix_add_generic_iplist (ucl_obj_tostring (value), &dkim_module_ctx->whitelist_ip); @@ -164,8 +164,8 @@ dkim_module_config (struct rspamd_config *cfg) } if ((value = rspamd_config_get_module_opt (cfg, "dkim", "domains")) != NULL) { - if (!add_map (cfg, ucl_obj_tostring (value), - "DKIM domains", read_kv_list, fin_kv_list, + if (!rspamd_map_add (cfg, ucl_obj_tostring (value), + "DKIM domains", rspamd_kv_list_read, rspamd_kv_list_fin, (void **)&dkim_module_ctx->dkim_domains)) { msg_warn ("cannot load dkim domains list from %s", ucl_obj_tostring (value)); diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index d89798c87..4162f164f 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -94,7 +94,7 @@ struct fuzzy_ctx { struct fuzzy_client_session { gint state; - fuzzy_hash_t *h; + rspamd_fuzzy_t *h; struct event ev; struct timeval tv; struct rspamd_task *task; @@ -105,7 +105,7 @@ struct fuzzy_client_session { struct fuzzy_learn_session { struct event ev; - fuzzy_hash_t *h; + rspamd_fuzzy_t *h; gint cmd; gint value; gint flag; @@ -254,7 +254,7 @@ fuzzy_normalize (gint32 in, double weight) } static const gchar * -fuzzy_to_string (fuzzy_hash_t *h) +fuzzy_to_string (rspamd_fuzzy_t *h) { static gchar strbuf [FUZZY_HASHLEN * 2 + 1]; const int max_print = 5; @@ -441,8 +441,8 @@ fuzzy_check_module_config (struct rspamd_config *cfg) rspamd_config_get_module_opt (cfg, "fuzzy_check", "whitelist")) != NULL) { fuzzy_module_ctx->whitelist = radix_create_compressed (); - if (!add_map (cfg, ucl_obj_tostring (value), - "Fuzzy whitelist", read_radix_list, fin_radix_list, + if (!rspamd_map_add (cfg, ucl_obj_tostring (value), + "Fuzzy whitelist", rspamd_radix_read, rspamd_radix_fin, (void **)&fuzzy_module_ctx->whitelist)) { radix_add_generic_iplist (ucl_obj_tostring (value), &fuzzy_module_ctx->whitelist); @@ -715,7 +715,7 @@ fuzzy_learn_callback (gint fd, short what, void *arg) static inline void register_fuzzy_call (struct rspamd_task *task, struct fuzzy_rule *rule, - fuzzy_hash_t *h) + rspamd_fuzzy_t *h) { struct fuzzy_client_session *session; struct upstream *selected; @@ -764,7 +764,7 @@ fuzzy_check_rule (struct rspamd_task *task, struct fuzzy_rule *rule) gchar *checksum; gsize hashlen; GList *cur; - fuzzy_hash_t *fake_fuzzy; + rspamd_fuzzy_t *fake_fuzzy; cur = task->text_parts; @@ -820,7 +820,7 @@ fuzzy_check_rule (struct rspamd_task *task, struct fuzzy_rule *rule) image->data->len); /* Construct fake fuzzy hash */ fake_fuzzy = rspamd_mempool_alloc0 (task->task_pool, - sizeof (fuzzy_hash_t)); + sizeof (rspamd_fuzzy_t)); rspamd_strlcpy (fake_fuzzy->hash_pipe, checksum, sizeof (fake_fuzzy->hash_pipe)); register_fuzzy_call (task, rule, fake_fuzzy); @@ -843,7 +843,7 @@ fuzzy_check_rule (struct rspamd_task *task, struct fuzzy_rule *rule) /* Construct fake fuzzy hash */ fake_fuzzy = rspamd_mempool_alloc0 (task->task_pool, - sizeof (fuzzy_hash_t)); + sizeof (rspamd_fuzzy_t)); rspamd_strlcpy (fake_fuzzy->hash_pipe, checksum, sizeof (fake_fuzzy->hash_pipe)); register_fuzzy_call (task, rule, fake_fuzzy); @@ -882,7 +882,7 @@ fuzzy_symbol_callback (struct rspamd_task *task, void *unused) static inline gboolean register_fuzzy_controller_call (struct rspamd_http_connection_entry *entry, - struct fuzzy_rule *rule, struct rspamd_task *task, fuzzy_hash_t *h, + struct fuzzy_rule *rule, struct rspamd_task *task, rspamd_fuzzy_t *h, gint cmd, gint value, gint flag, gint *saved, GError **err) { struct fuzzy_learn_session *s; @@ -908,8 +908,8 @@ register_fuzzy_controller_call (struct rspamd_http_connection_entry *entry, msec_to_tv (fuzzy_module_ctx->io_timeout, &s->tv); s->task = task; s->h = - rspamd_mempool_alloc (task->task_pool, sizeof (fuzzy_hash_t)); - memcpy (s->h, h, sizeof (fuzzy_hash_t)); + rspamd_mempool_alloc (task->task_pool, sizeof (rspamd_fuzzy_t)); + memcpy (s->h, h, sizeof (rspamd_fuzzy_t)); s->http_entry = entry; s->server = selected; s->cmd = cmd; @@ -947,7 +947,7 @@ fuzzy_process_rule (struct rspamd_http_connection_entry *entry, struct rspamd_image *image; GList *cur; gchar *checksum; - fuzzy_hash_t fake_fuzzy; + rspamd_fuzzy_t fake_fuzzy; gint processed = 0; /* Plan new event for writing */ diff --git a/src/plugins/spf.c b/src/plugins/spf.c index adc61e17c..bbb9b8a76 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -146,8 +146,8 @@ spf_module_config (struct rspamd_config *cfg) } if ((value = rspamd_config_get_module_opt (cfg, "spf", "whitelist")) != NULL) { - if (!add_map (cfg, ucl_obj_tostring (value), - "SPF whitelist", read_radix_list, fin_radix_list, + if (!rspamd_map_add (cfg, ucl_obj_tostring (value), + "SPF whitelist", rspamd_radix_read, rspamd_radix_fin, (void **)&spf_module_ctx->whitelist_ip)) { radix_add_generic_iplist (ucl_obj_tostring (value), &spf_module_ctx->whitelist_ip); diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 3c141256d..2fe35031a 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -90,7 +90,7 @@ exception_insert (gpointer st, gconstpointer key, gpointer value) GHashTable **t = st; gint level = 0; const gchar *p = key; - f_str_t *val; + rspamd_fstring_t *val; while (*p) { @@ -106,12 +106,12 @@ exception_insert (gpointer st, gconstpointer key, gpointer value) return; } - val = g_malloc (sizeof (f_str_t)); + val = g_malloc (sizeof (rspamd_fstring_t)); val->begin = (gchar *)key; val->len = strlen (key); if (t[level] == NULL) { - t[level] = g_hash_table_new_full (fstr_strcase_hash, - fstr_strcase_equal, + t[level] = g_hash_table_new_full (rspamd_fstring_hash, + rspamd_fstring_equal, g_free, NULL); } @@ -128,7 +128,7 @@ read_exceptions_list (rspamd_mempool_t * pool, data->cur_data = rspamd_mempool_alloc0 (pool, sizeof (GHashTable *) * MAX_LEVELS); } - return abstract_parse_list (pool, + return rspamd_parse_abstract_list (pool, chunk, len, data, @@ -217,7 +217,7 @@ read_redirectors_list (rspamd_mempool_t * pool, redirector_item_free); } - return abstract_parse_list (pool, + return rspamd_parse_abstract_list (pool, chunk, len, data, @@ -379,7 +379,7 @@ surbl_module_config (struct rspamd_config *cfg) if ((value = rspamd_config_get_module_opt (cfg, "surbl", "redirector_hosts_map")) != NULL) { - add_map (cfg, ucl_obj_tostring ( + rspamd_map_add (cfg, ucl_obj_tostring ( value), "SURBL redirectors list", read_redirectors_list, fin_redirectors_list, (void **)&surbl_module_ctx->redirector_hosts); @@ -394,7 +394,7 @@ surbl_module_config (struct rspamd_config *cfg) } if ((value = rspamd_config_get_module_opt (cfg, "surbl", "exceptions")) != NULL) { - if (add_map (cfg, ucl_obj_tostring (value), + if (rspamd_map_add (cfg, ucl_obj_tostring (value), "SURBL exceptions list", read_exceptions_list, fin_exceptions_list, (void **)&surbl_module_ctx->exceptions)) { surbl_module_ctx->tld2_file = rspamd_mempool_strdup ( @@ -404,8 +404,8 @@ surbl_module_config (struct rspamd_config *cfg) } if ((value = rspamd_config_get_module_opt (cfg, "surbl", "whitelist")) != NULL) { - if (add_map (cfg, ucl_obj_tostring (value), - "SURBL whitelist", read_host_list, fin_host_list, + if (rspamd_map_add (cfg, ucl_obj_tostring (value), + "SURBL whitelist", rspamd_hosts_read, rspamd_hosts_fin, (void **)&surbl_module_ctx->whitelist)) { surbl_module_ctx->whitelist_file = rspamd_mempool_strdup ( surbl_module_ctx->surbl_pool, @@ -571,7 +571,7 @@ surbl_module_reconfig (struct rspamd_config *cfg) static gchar * format_surbl_request (rspamd_mempool_t * pool, - f_str_t * hostname, + rspamd_fstring_t * hostname, struct suffix_item *suffix, gboolean append_suffix, GError ** err, @@ -585,7 +585,7 @@ format_surbl_request (rspamd_mempool_t * pool, gint len, slen, r, i, dots_num = 0, level = MAX_LEVELS; gboolean is_numeric = TRUE; guint64 ip_num; - f_str_t f; + rspamd_fstring_t f; if (G_LIKELY (suffix != NULL)) { slen = strlen (suffix->suffix); @@ -758,7 +758,7 @@ make_surbl_requests (struct uri *url, struct rspamd_task *task, struct suffix_item *suffix, gboolean forced, GTree *tree) { gchar *surbl_req; - f_str_t f; + rspamd_fstring_t f; GError *err = NULL; struct dns_param *param; @@ -1147,7 +1147,7 @@ write_urls_buffer (gpointer key, gpointer value, gpointer cbdata) { struct urls_tree_cb_data *cb = cbdata; struct uri *url = value; - f_str_t f; + rspamd_fstring_t f; gchar *urlstr; gsize len; |