diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-08-06 20:48:11 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-08-06 20:48:11 +0400 |
commit | 9aa989ea76ee78107ed7ae02a3d1b8e297f57b4c (patch) | |
tree | c925bd5a8df5394f583ba79ae69794338dd0821a /src/controller.c | |
parent | 5d0e4d334fef7f0fe683040d32e2a53b503315f2 (diff) | |
download | rspamd-9aa989ea76ee78107ed7ae02a3d1b8e297f57b4c.tar.gz rspamd-9aa989ea76ee78107ed7ae02a3d1b8e297f57b4c.zip |
* One more try to improve accuracy of winnow algorithm
Diffstat (limited to 'src/controller.c')
-rw-r--r-- | src/controller.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/controller.c b/src/controller.c index 15b14cf8d..a79159c69 100644 --- a/src/controller.c +++ b/src/controller.c @@ -926,11 +926,18 @@ controller_read_socket (f_str_t * in, void *arg) while (cur) { w = cur->data; - i += rspamd_snprintf (out_buf + i, sizeof (out_buf) - i, "%s: %.2Lg" CRLF, w->name, w->weight); + i += rspamd_snprintf (out_buf + i, sizeof (out_buf) - i, "%s: %G" CRLF, w->name, w->weight); cur = g_list_next (cur); } - if (!rspamd_dispatcher_write (session->dispatcher, out_buf, i, FALSE, FALSE)) { - return FALSE; + if (i != 0) { + if (!rspamd_dispatcher_write (session->dispatcher, out_buf, i, FALSE, FALSE)) { + return FALSE; + } + } + else { + if (!rspamd_dispatcher_write (session->dispatcher, "weights failed: classifier error", 0, FALSE, TRUE)) { + return FALSE; + } } free_task (task, FALSE); |