diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-04-30 13:26:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-04-30 13:26:51 +0100 |
commit | d6643f35d783784911ad2e2ca754bcfed29eb11d (patch) | |
tree | 55554d57d4439e278788a261eb5ad7e5016a1372 /src/libmime | |
parent | 7e66b3bd08dbca9356013a3777f786076d1dacea (diff) | |
download | rspamd-d6643f35d783784911ad2e2ca754bcfed29eb11d.tar.gz rspamd-d6643f35d783784911ad2e2ca754bcfed29eb11d.zip |
Refactor config API.
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/filter.c | 14 | ||||
-rw-r--r-- | src/libmime/filter.h | 4 | ||||
-rw-r--r-- | src/libmime/protocol.c | 2 | ||||
-rw-r--r-- | src/libmime/smtp_utils.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c index 8144439e0..9932b814d 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -503,10 +503,10 @@ check_autolearn (struct statfile_autolearn_params *params, struct rspamd_task *t } void -process_autolearn (struct statfile *st, struct rspamd_task *task, GTree * tokens, struct classifier *classifier, gchar *filename, struct classifier_ctx *ctx) +process_autolearn (struct rspamd_statfile_config *st, struct rspamd_task *task, GTree * tokens, struct classifier *classifier, gchar *filename, struct classifier_ctx *ctx) { stat_file_t *statfile; - struct statfile *unused; + struct rspamd_statfile_config *unused; if (check_autolearn (st->autolearn, task)) { if (tokens) { @@ -582,10 +582,10 @@ classifiers_callback (gpointer value, void *arg) { struct classifiers_cbdata *cbdata = arg; struct rspamd_task *task; - struct classifier_config *cl = value; + struct rspamd_classifier_config *cl = value; struct classifier_ctx *ctx; struct mime_text_part *text_part, *p1, *p2; - struct statfile *st; + struct rspamd_statfile_config *st; GTree *tokens = NULL; GList *cur; f_str_t c; @@ -872,12 +872,12 @@ gboolean learn_task (const gchar *statfile, struct rspamd_task *task, GError **err) { GList *cur, *ex; - struct classifier_config *cl; + struct rspamd_classifier_config *cl; struct classifier_ctx *cls_ctx; gchar *s; f_str_t c; GTree *tokens = NULL; - struct statfile *st; + struct rspamd_statfile_config *st; stat_file_t *stf; gdouble sum; struct mime_text_part *part, *p1, *p2; @@ -997,7 +997,7 @@ learn_task (const gchar *statfile, struct rspamd_task *task, GError **err) } gboolean -learn_task_spam (struct classifier_config *cl, struct rspamd_task *task, gboolean is_spam, GError **err) +learn_task_spam (struct rspamd_classifier_config *cl, struct rspamd_task *task, gboolean is_spam, GError **err) { GList *cur, *ex; struct classifier_ctx *cls_ctx; diff --git a/src/libmime/filter.h b/src/libmime/filter.h index 258bd9447..7c3f3e51e 100644 --- a/src/libmime/filter.h +++ b/src/libmime/filter.h @@ -12,7 +12,7 @@ struct rspamd_task; struct rspamd_settings; -struct classifier_config; +struct rspamd_classifier_config; typedef double (*metric_cons_func)(struct rspamd_task *task, const gchar *metric_name, const gchar *func_name); typedef void (*filter_func)(struct rspamd_task *task); @@ -147,7 +147,7 @@ gboolean learn_task (const gchar *statfile, struct rspamd_task *task, GError **e * @param err pointer to GError * @return true if learn succeed */ -gboolean learn_task_spam (struct classifier_config *cl, struct rspamd_task *task, gboolean is_spam, GError **err); +gboolean learn_task_spam (struct rspamd_classifier_config *cl, struct rspamd_task *task, gboolean is_spam, GError **err); /* * Get action from a string diff --git a/src/libmime/protocol.c b/src/libmime/protocol.c index 1b7bdf42f..57ef9fe42 100644 --- a/src/libmime/protocol.c +++ b/src/libmime/protocol.c @@ -274,7 +274,7 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, struct rspamd_http_mes case 'j': case 'J': if (g_ascii_strcasecmp (headern, JSON_HEADER) == 0) { - task->is_json = parse_flag (h->value->str); + task->is_json = rspamd_config_parse_flag (h->value->str); } else { debug_task ("wrong header: %s", headern); diff --git a/src/libmime/smtp_utils.c b/src/libmime/smtp_utils.c index 5178de9dd..5d8f94f64 100644 --- a/src/libmime/smtp_utils.c +++ b/src/libmime/smtp_utils.c @@ -348,7 +348,7 @@ parse_upstreams_line (rspamd_mempool_t *pool, struct smtp_upstream *upstreams, c (*count) ++; } else { - if (! parse_host_port (pool, p, &cur->addr, &cur->port)) { + if (! rspamd_parse_host_port (pool, p, &cur->addr, &cur->port)) { g_strfreev (strv); return FALSE; } |