diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-06 15:01:55 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-06 15:01:55 +0000 |
commit | f58a7f7a2bba476fb6c5d0f6b787ae2fc3446210 (patch) | |
tree | 937289b6a10ae43aa717f4d16fef80048589e067 /src | |
parent | bf1498a4075d54a5e95b085a613e1aea5e16b07f (diff) | |
download | rspamd-f58a7f7a2bba476fb6c5d0f6b787ae2fc3446210.tar.gz rspamd-f58a7f7a2bba476fb6c5d0f6b787ae2fc3446210.zip |
Improve logging for fuzzy.0.6.2
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/fuzzy_check.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 4c06d7b35..48414a82b 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -595,6 +595,7 @@ fuzzy_learn_callback (gint fd, short what, void *arg) const gchar *cmd_name; gint r; + cmd_name = (session->cmd == FUZZY_WRITE ? "add" : "delete"); if (what == EV_WRITE) { /* Send command to storage */ cmd.blocksize = session->h->block_size; @@ -617,7 +618,6 @@ fuzzy_learn_callback (gint fd, short what, void *arg) } } else if (what == EV_READ) { - cmd_name = (session->cmd == FUZZY_WRITE ? "add" : "delete"); if (read (fd, buf, sizeof (buf)) == -1) { msg_info ("cannot %s fuzzy hash for message <%s>, list %s:%d", cmd_name, session->task->message_id, session->rule->symbol, session->flag); @@ -647,6 +647,10 @@ fuzzy_learn_callback (gint fd, short what, void *arg) } else { errno = ETIMEDOUT; + if (*(session->err) == NULL) { + g_set_error (session->err, + g_quark_from_static_string ("fuzzy check"), EINVAL, "%s fuzzy, IO timeout", cmd_name); + } goto err; } |