diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-09-18 20:42:09 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2012-09-18 20:42:09 +0400 |
commit | df07d992fb389fa691e4206fc27593bb96af8630 (patch) | |
tree | a884bea7a40f8e4d06f17780342d2a57e406592f /src/client | |
parent | d071dc92a2b0f853309b1c450d739dd4bb69f108 (diff) | |
download | rspamd-df07d992fb389fa691e4206fc27593bb96af8630.tar.gz rspamd-df07d992fb389fa691e4206fc27593bb96af8630.zip |
Fix learning throught restfull interface.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/rspamc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c index 1c7eaf318..38855e7c4 100644 --- a/src/client/rspamc.c +++ b/src/client/rspamc.c @@ -430,7 +430,7 @@ learn_rspamd_stdin (gboolean is_spam) results = rspamd_controller_command_memory (client, is_spam ? "learn_spam" : "learn_ham", password, params, in_buf, r, &err); g_hash_table_destroy (params); - if (results == NULL) { + if (results == NULL || err != NULL) { if (err != NULL) { fprintf (stderr, "cannot learn message: %s\n", err->message); } @@ -475,7 +475,7 @@ learn_rspamd_file (gboolean is_spam, const gchar *file) results = rspamd_controller_command_file (client, is_spam ? "learn_spam" : "learn_ham", password, params, file, &err); g_hash_table_destroy (params); - if (results == NULL) { + if (results == NULL || err != NULL) { if (err != NULL) { fprintf (stderr, "cannot learn message: %s\n", err->message); } @@ -565,7 +565,7 @@ rspamd_do_controller_simple_command (gchar *command) add_rspamd_server (TRUE); results = rspamd_controller_command_simple (client, command, password, NULL, &err); - if (results == NULL) { + if (results == NULL || err != NULL) { if (err != NULL) { fprintf (stderr, "cannot perform command: %s\n", err->message); } |