aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-29 17:02:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-29 17:03:24 +0000
commitd2150fc165e99bb8d6a7411bffee6fd7d36d4763 (patch)
treefc4c6449d441835e860666e942fa6a08dec3aca1 /src/libmime
parent26b07297ed8936879d09ac113f84aa660f133901 (diff)
downloadrspamd-d2150fc165e99bb8d6a7411bffee6fd7d36d4763.tar.gz
rspamd-d2150fc165e99bb8d6a7411bffee6fd7d36d4763.zip
Refactor function names.
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/expressions.c4
-rw-r--r--src/libmime/filter.c18
-rw-r--r--src/libmime/message.c4
-rw-r--r--src/libmime/message.h6
-rw-r--r--src/libmime/smtp_proto.c20
-rw-r--r--src/libmime/smtp_proto.h4
6 files changed, 28 insertions, 28 deletions
diff --git a/src/libmime/expressions.c b/src/libmime/expressions.c
index 154649b51..0ff34e24b 100644
--- a/src/libmime/expressions.c
+++ b/src/libmime/expressions.c
@@ -1168,11 +1168,11 @@ rspamd_parts_distance (struct rspamd_task * task, GList * args, void *unused)
}
if (!p1->is_empty && !p2->is_empty) {
if (p1->diff_str != NULL && p2->diff_str != NULL) {
- diff = compare_diff_distance_normalized (p1->diff_str,
+ diff = rspamd_diff_distance_normalized (p1->diff_str,
p2->diff_str);
}
else {
- diff = fuzzy_compare_parts (p1, p2);
+ diff = rspamd_fuzzy_compare_parts (p1, p2);
}
debug_task (
"got likeliness between parts of %d%%, threshold is %d%%",
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index 091887839..c6a4752fa 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -746,7 +746,7 @@ classifiers_callback (gpointer value, void *arg)
struct rspamd_statfile_config *st;
GTree *tokens = NULL;
GList *cur;
- f_str_t c;
+ rspamd_fstring_t c;
gchar *header = NULL;
gint *dist = NULL, diff;
gboolean is_twopart = FALSE, is_headers = FALSE;
@@ -807,10 +807,10 @@ classifiers_callback (gpointer value, void *arg)
p2 = text_part;
if (p1->diff_str != NULL && p2->diff_str != NULL) {
diff =
- compare_diff_distance (p1->diff_str, p2->diff_str);
+ rspamd_diff_distance (p1->diff_str, p2->diff_str);
}
else {
- diff = fuzzy_compare_parts (p1, p2);
+ diff = rspamd_fuzzy_compare_parts (p1, p2);
}
if (diff >= COMMON_PART_FACTOR) {
msg_info (
@@ -1115,7 +1115,7 @@ rspamd_learn_task (const gchar *statfile, struct rspamd_task *task, GError **err
struct rspamd_classifier_config *cl;
struct classifier_ctx *cls_ctx;
gchar *s;
- f_str_t c;
+ rspamd_fstring_t c;
GTree *tokens = NULL;
struct rspamd_statfile_config *st;
stat_file_t *stf;
@@ -1174,10 +1174,10 @@ rspamd_learn_task (const gchar *statfile, struct rspamd_task *task, GError **err
p1 = cur->prev->data;
p2 = part;
if (p1->diff_str != NULL && p2->diff_str != NULL) {
- diff = compare_diff_distance (p1->diff_str, p2->diff_str);
+ diff = rspamd_diff_distance (p1->diff_str, p2->diff_str);
}
else {
- diff = fuzzy_compare_parts (p1, p2);
+ diff = rspamd_fuzzy_compare_parts (p1, p2);
}
if (diff >= COMMON_PART_FACTOR) {
msg_info (
@@ -1261,7 +1261,7 @@ rspamd_learn_task_spam (struct rspamd_classifier_config *cl,
{
GList *cur, *ex;
struct classifier_ctx *cls_ctx;
- f_str_t c;
+ rspamd_fstring_t c;
GTree *tokens = NULL;
struct mime_text_part *part, *p1, *p2;
gboolean is_utf = FALSE, is_twopart = FALSE;
@@ -1292,10 +1292,10 @@ rspamd_learn_task_spam (struct rspamd_classifier_config *cl,
p1 = cur->prev->data;
p2 = part;
if (p1->diff_str != NULL && p2->diff_str != NULL) {
- diff = compare_diff_distance (p1->diff_str, p2->diff_str);
+ diff = rspamd_diff_distance (p1->diff_str, p2->diff_str);
}
else {
- diff = fuzzy_compare_parts (p1, p2);
+ diff = rspamd_fuzzy_compare_parts (p1, p2);
}
if (diff >= COMMON_PART_FACTOR) {
msg_info (
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 3a1baf798..0e33967ca 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1090,7 +1090,7 @@ process_text_part (struct rspamd_task *task,
}
url_parse_text (task->task_pool, task, text_part, TRUE);
- fuzzy_init_part (text_part, task->task_pool, task->cfg->max_diff);
+ rspamd_fuzzy_from_text_part (text_part, task->task_pool, task->cfg->max_diff);
rspamd_mempool_add_destructor (task->task_pool,
(rspamd_mempool_destruct_t) free_byte_array_callback,
text_part->content);
@@ -1117,7 +1117,7 @@ process_text_part (struct rspamd_task *task,
text_part);
text_part->orig = part_content;
url_parse_text (task->task_pool, task, text_part, FALSE);
- fuzzy_init_part (text_part, task->task_pool, task->cfg->max_diff);
+ rspamd_fuzzy_from_text_part (text_part, task->task_pool, task->cfg->max_diff);
task->text_parts = g_list_prepend (task->text_parts, text_part);
}
}
diff --git a/src/libmime/message.h b/src/libmime/message.h
index 35eb3ff1e..ddc5939fa 100644
--- a/src/libmime/message.h
+++ b/src/libmime/message.h
@@ -31,11 +31,11 @@ struct mime_text_part {
GByteArray *content;
GNode *html_nodes;
GList *urls_offset; /**< list of offsets of urls */
- fuzzy_hash_t *fuzzy;
- fuzzy_hash_t *double_fuzzy;
+ rspamd_fuzzy_t *fuzzy;
+ rspamd_fuzzy_t *double_fuzzy;
GMimeObject *parent;
GUnicodeScript script;
- f_str_t *diff_str;
+ rspamd_fstring_t *diff_str;
};
struct received_header {
diff --git a/src/libmime/smtp_proto.c b/src/libmime/smtp_proto.c
index c716b7480..ec7ab191a 100644
--- a/src/libmime/smtp_proto.c
+++ b/src/libmime/smtp_proto.c
@@ -57,7 +57,7 @@ make_smtp_error (rspamd_mempool_t *pool,
gboolean
parse_smtp_command (struct smtp_session *session,
- f_str_t *line,
+ rspamd_fstring_t *line,
struct smtp_command **cmd)
{
enum {
@@ -68,7 +68,7 @@ parse_smtp_command (struct smtp_session *session,
} state;
gchar *p, *c, ch, cmd_buf[4];
guint i;
- f_str_t *arg = NULL;
+ rspamd_fstring_t *arg = NULL;
struct smtp_command *pcmd;
if (line->len == 0) {
@@ -164,7 +164,7 @@ parse_smtp_command (struct smtp_session *session,
}
else if (ch != ' ' && ch != ':') {
state = SMTP_PARSE_ARGUMENT;
- arg = rspamd_mempool_alloc (session->pool, sizeof (f_str_t));
+ arg = rspamd_mempool_alloc (session->pool, sizeof (rspamd_fstring_t));
c = p;
}
break;
@@ -209,7 +209,7 @@ end:
}
static gboolean
-check_smtp_path (f_str_t *path)
+check_smtp_path (rspamd_fstring_t *path)
{
guint i;
gchar *p;
@@ -230,7 +230,7 @@ check_smtp_path (f_str_t *path)
gboolean
parse_smtp_helo (struct smtp_session *session, struct smtp_command *cmd)
{
- f_str_t *arg;
+ rspamd_fstring_t *arg;
if (cmd->args == NULL) {
session->error = SMTP_ERROR_BAD_ARGUMENTS;
@@ -265,7 +265,7 @@ parse_smtp_helo (struct smtp_session *session, struct smtp_command *cmd)
gboolean
parse_smtp_from (struct smtp_session *session, struct smtp_command *cmd)
{
- f_str_t *arg;
+ rspamd_fstring_t *arg;
GList *cur = cmd->args;
if (cmd->args == NULL) {
@@ -303,7 +303,7 @@ parse_smtp_from (struct smtp_session *session, struct smtp_command *cmd)
gboolean
parse_smtp_rcpt (struct smtp_session *session, struct smtp_command *cmd)
{
- f_str_t *arg;
+ rspamd_fstring_t *arg;
GList *cur = cmd->args;
if (cmd->args == NULL) {
@@ -339,7 +339,7 @@ parse_smtp_rcpt (struct smtp_session *session, struct smtp_command *cmd)
/* Return -1 if there are some error, 1 if all is ok and 0 in case of incomplete reply */
static gint
-check_smtp_ustream_reply (f_str_t *in, gchar success_code)
+check_smtp_ustream_reply (rspamd_fstring_t *in, gchar success_code)
{
gchar *p;
@@ -368,7 +368,7 @@ smtp_upstream_write_list (GList *args, gchar *buf, size_t buflen)
{
GList *cur = args;
size_t r = 0;
- f_str_t *arg;
+ rspamd_fstring_t *arg;
while (cur && r < buflen - 3) {
arg = cur->data;
@@ -401,7 +401,7 @@ smtp_upstream_write_socket (void *arg)
}
gboolean
-smtp_upstream_read_socket (f_str_t * in, void *arg)
+smtp_upstream_read_socket (rspamd_fstring_t * in, void *arg)
{
struct smtp_session *session = arg;
gchar outbuf[BUFSIZ];
diff --git a/src/libmime/smtp_proto.h b/src/libmime/smtp_proto.h
index a5c865889..a0f2ec5c2 100644
--- a/src/libmime/smtp_proto.h
+++ b/src/libmime/smtp_proto.h
@@ -53,7 +53,7 @@ gchar * make_smtp_error (rspamd_mempool_t *pool,
* Parse a single SMTP command
*/
gboolean parse_smtp_command (struct smtp_session *session,
- f_str_t *line,
+ rspamd_fstring_t *line,
struct smtp_command **cmd);
/*
@@ -79,7 +79,7 @@ gboolean parse_smtp_rcpt (struct smtp_session *session,
/*
* Read a line from SMTP upstream
*/
-gboolean smtp_upstream_read_socket (f_str_t * in, void *arg);
+gboolean smtp_upstream_read_socket (rspamd_fstring_t * in, void *arg);
/*
* Write to SMTP upstream