diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-01 15:26:39 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-01 15:26:39 +0100 |
commit | 35dea66794440026b8dbdda076c869c09dd4673f (patch) | |
tree | 4f39dfdbf5ff0a0005f520f1a95b23c00d7b9a85 /src/libmime | |
parent | 112e46f516bdebea70e970c67aa660480157a683 (diff) | |
download | rspamd-35dea66794440026b8dbdda076c869c09dd4673f.tar.gz rspamd-35dea66794440026b8dbdda076c869c09dd4673f.zip |
Improve error reporting for HTTP sessions.
Diffstat (limited to 'src/libmime')
-rw-r--r-- | src/libmime/protocol.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libmime/protocol.c b/src/libmime/protocol.c index 52336c81c..69d849d52 100644 --- a/src/libmime/protocol.c +++ b/src/libmime/protocol.c @@ -780,8 +780,10 @@ rspamd_protocol_write_reply (struct rspamd_task *task) top = ucl_object_typed_new (UCL_OBJECT); debug_task ("writing reply to client"); if (task->error_code != 0) { - msg->code = task->error_code; - ucl_object_insert_key (top, ucl_object_fromstring (task->last_error), "error", 0, false); + msg->code = 500 + task->error_code % 100; + msg->status = g_string_new (task->last_error); + ucl_object_insert_key (top, ucl_object_fromstring (task->last_error), + "error", 0, false); msg->body = g_string_sized_new (256); rspamd_ucl_emit_gstring (top, UCL_EMIT_JSON_COMPACT, msg->body); ucl_object_unref (top); |