From: Vsevolod Stakhov Date: Fri, 17 Feb 2017 13:09:33 +0000 (+0000) Subject: [Minor] Log fuzzy command when processing changes X-Git-Tag: 1.5.0~92 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=361fb6df11468548eb57856dad2e74b082dd7085;p=rspamd.git [Minor] Log fuzzy command when processing changes Issue: #1267 --- diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 1804e8648..38456f4ca 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1959,6 +1959,7 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) return_finished } ret = return_want_more; guint i, nreplied; + const gchar *op = "process"; task = session->task; @@ -2005,9 +2006,17 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) ftype = "txt"; } + if (io->cmd.cmd == FUZZY_WRITE) { + op = "added"; + } + else if (io->cmd.cmd == FUZZY_DEL) { + op = "deleted"; + } + if (rep->prob > 0.5) { - msg_info_task ("processed fuzzy hash (%s) %*xs, list: %s:%d for " - "message <%s>", + msg_info_task ("%s fuzzy hash (%s) %*xs, list: %s:%d for " + "message <%s>", + op, ftype, (gint)sizeof (cmd->digest), cmd->digest, symbol, @@ -2015,10 +2024,11 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) session->task->message_id); } else { - msg_info_task ("cannot process fuzzy hash (%s) for message " + msg_info_task ("fuzzy hash (%s) for message cannot be %s" "<%s>, %*xs, " "list %s:%d, error: %d", ftype, + op, session->task->message_id, (gint)sizeof (cmd->digest), cmd->digest, symbol,