diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-12 13:02:40 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-12 13:02:40 +0100 |
commit | db1f808884e11639306010ec629abb2c9c370393 (patch) | |
tree | 805fb7322a765d46e0363aa938fd521724fbd1fc /src | |
parent | e180aa8a5b7a63af744c8704ba47caaaad6de05d (diff) | |
download | rspamd-db1f808884e11639306010ec629abb2c9c370393.tar.gz rspamd-db1f808884e11639306010ec629abb2c9c370393.zip |
Fix HTTP reply status.
Diffstat (limited to 'src')
-rw-r--r-- | src/libserver/rspamd_control.c | 5 | ||||
-rw-r--r-- | src/libserver/worker_util.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libserver/rspamd_control.c b/src/libserver/rspamd_control.c index e8c24ff12..12a307625 100644 --- a/src/libserver/rspamd_control.c +++ b/src/libserver/rspamd_control.c @@ -92,13 +92,13 @@ rspamd_control_send_error (struct rspamd_control_session *session, msg = rspamd_http_new_message (HTTP_RESPONSE); va_start (args, error_msg); - msg->status = rspamd_fstring_sized_new (128); + msg->status = rspamd_fstring_new (); rspamd_vprintf_fstring (&msg->status, error_msg, args); va_end (args); msg->date = time (NULL); msg->code = code; - msg->body = rspamd_fstring_sized_new (128); + msg->body = rspamd_fstring_new (); rspamd_printf_fstring (&msg->body, "{\"error\":\"%V\"}", msg->status); rspamd_http_connection_reset (session->conn); rspamd_http_connection_write_message (session->conn, @@ -120,6 +120,7 @@ rspamd_control_send_ucl (struct rspamd_control_session *session, msg = rspamd_http_new_message (HTTP_RESPONSE); msg->date = time (NULL); msg->code = 200; + msg->status = rspamd_fstring_new_init ("OK", 2); msg->body = rspamd_fstring_sized_new (BUFSIZ); rspamd_ucl_emit_fstring (obj, UCL_EMIT_JSON_COMPACT, &msg->body); rspamd_http_connection_reset (session->conn); diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c index 02be93d8f..47d85d6bc 100644 --- a/src/libserver/worker_util.c +++ b/src/libserver/worker_util.c @@ -312,13 +312,13 @@ rspamd_controller_send_error (struct rspamd_http_connection_entry *entry, msg = rspamd_http_new_message (HTTP_RESPONSE); va_start (args, error_msg); - msg->status = rspamd_fstring_sized_new (128); + msg->status = rspamd_fstring_new (); rspamd_vprintf_fstring (&msg->status, error_msg, args); va_end (args); msg->date = time (NULL); msg->code = code; - msg->body = rspamd_fstring_sized_new (128); + msg->body = rspamd_fstring_new (); rspamd_printf_fstring (&msg->body, "{\"error\":\"%V\"}", msg->status); rspamd_http_connection_reset (entry->conn); rspamd_http_connection_write_message (entry->conn, @@ -341,6 +341,7 @@ rspamd_controller_send_string (struct rspamd_http_connection_entry *entry, msg = rspamd_http_new_message (HTTP_RESPONSE); msg->date = time (NULL); msg->code = 200; + msg->status = rspamd_fstring_new_init ("OK", 2); msg->body = rspamd_fstring_new_init (str, strlen (str)); rspamd_http_connection_reset (entry->conn); rspamd_http_connection_write_message (entry->conn, @@ -363,6 +364,7 @@ rspamd_controller_send_ucl (struct rspamd_http_connection_entry *entry, msg = rspamd_http_new_message (HTTP_RESPONSE); msg->date = time (NULL); msg->code = 200; + msg->status = rspamd_fstring_new_init ("OK", 2); msg->body = rspamd_fstring_sized_new (BUFSIZ); rspamd_ucl_emit_fstring (obj, UCL_EMIT_JSON_COMPACT, &msg->body); rspamd_http_connection_reset (entry->conn); |