diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-05 14:11:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-05 14:11:46 +0000 |
commit | f56cb9d4eca864b9943d33c1f83fcff49ec58a67 (patch) | |
tree | 3bf6a693e3f10632f5d7cdbbe564d0499dc1ed30 | |
parent | faed2448dc4f371fb62444fae8fd3cdf024fc6d1 (diff) | |
download | rspamd-f56cb9d4eca864b9943d33c1f83fcff49ec58a67.tar.gz rspamd-f56cb9d4eca864b9943d33c1f83fcff49ec58a67.zip |
[Minor] Add type of fuzzy to log files
-rw-r--r-- | src/plugins/fuzzy_check.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 85f5c3bb3..79de7bfe9 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1625,6 +1625,7 @@ fuzzy_insert_result (struct fuzzy_client_session *session, struct rspamd_task *task = session->task; double nval; guchar buf[2048]; + const gchar *type = "bin"; /* Get mapping by flag */ if ((map = @@ -1651,15 +1652,21 @@ fuzzy_insert_result (struct fuzzy_client_session *session, if (io && (io->flags & FUZZY_CMD_FLAG_IMAGE)) { nval *= rspamd_normalize_probability (rep->prob, 0.5); + type = "img"; } else { /* XXX: we need something better here */ + if (cmd->shingles_count > 0) { + type = "txt"; + } + nval *= rep->prob; } msg_info_task ( - "found fuzzy hash %*xs with weight: " + "found fuzzy hash(%s) %*xs with weight: " "%.2f, probability %.2f, in list: %s:%d%s", + type, (gint)sizeof (cmd->digest), cmd->digest, nval, (gdouble)rep->prob, @@ -1669,10 +1676,11 @@ fuzzy_insert_result (struct fuzzy_client_session *session, if (map != NULL || !session->rule->skip_unknown) { rspamd_snprintf (buf, sizeof (buf), - "%d:%*xs:%.2f", + "%d:%*xs:%.2f:%s", rep->flag, rspamd_fuzzy_hash_len, cmd->digest, - rep->prob); + rep->prob, + type); rspamd_task_insert_result_single (session->task, symbol, nval, |