diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-23 11:21:05 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-23 11:21:05 +0100 |
commit | 55159a5a8ef66e1a05fd93095623d90056c22fcd (patch) | |
tree | 1b72bb975d86ab680d899c4b18a65bbefbd2f22b /src/plugins | |
parent | 0c4562ba035ffc79591f1ed54e562678bfca53ac (diff) | |
download | rspamd-55159a5a8ef66e1a05fd93095623d90056c22fcd.tar.gz rspamd-55159a5a8ef66e1a05fd93095623d90056c22fcd.zip |
[Minor] Treat skipped error properly
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/fuzzy_check.c | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 85e6d2c64..63693edf2 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -1882,6 +1882,13 @@ fuzzy_check_try_read (struct fuzzy_client_session *session) "fuzzy check error for %d: forbidden", rep->flag); } + else if (rep->value == 401) { + if (cmd->cmd != FUZZY_CHECK) { + msg_info_task ( + "fuzzy check error for %d: skipped by server", + rep->flag); + } + } else if (rep->value != 0) { msg_info_task ( "fuzzy check error for %d: unknown error (%d)", @@ -2142,21 +2149,42 @@ fuzzy_controller_io_callback (gint fd, short what, void *arg) session->task->message_id); } else { - 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, - rep->flag, - rep->value); - - if (*(session->err) == NULL) { - g_set_error (session->err, - g_quark_from_static_string ("fuzzy check"), - rep->value, "process fuzzy error"); + if (rep->value == 401) { + msg_info_task ( + "fuzzy hash (%s) for message cannot be %s" + "<%s>, %*xs, " + "list %s:%d, skipped by server", + ftype, + op, + session->task->message_id, + (gint) sizeof (cmd->digest), cmd->digest, + symbol, + rep->flag); + + if (*(session->err) == NULL) { + g_set_error (session->err, + g_quark_from_static_string ("fuzzy check"), + rep->value, "fuzzy hash is skipped"); + } + } + else { + 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, + rep->flag, + rep->value); + + if (*(session->err) == NULL) { + g_set_error (session->err, + g_quark_from_static_string ("fuzzy check"), + rep->value, "process fuzzy error"); + } } ret = return_finished; |