aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/control.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-10 16:38:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-10 16:38:29 +0100
commit5bbd698d9649a09e1992caef99b1482c62a5a54f (patch)
tree3c9032073c44c175b3009e99a30408c1693defe0 /src/rspamadm/control.c
parentde6e99a081384da39d119e15375febf0028cea9d (diff)
downloadrspamd-5bbd698d9649a09e1992caef99b1482c62a5a54f.tar.gz
rspamd-5bbd698d9649a09e1992caef99b1482c62a5a54f.zip
[Rework] Finish rework for the rest of places that use HTTP
Diffstat (limited to 'src/rspamadm/control.c')
-rw-r--r--src/rspamadm/control.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rspamadm/control.c b/src/rspamadm/control.c
index de6e48346..52fec99c6 100644
--- a/src/rspamadm/control.c
+++ b/src/rspamadm/control.c
@@ -17,7 +17,8 @@
#include "rspamadm.h"
#include "cryptobox.h"
#include "printf.h"
-#include "http.h"
+#include "libutil/http.h"
+#include "libutil/http_private.h"
#include "addr.h"
#include "unix-std.h"
#include <event.h>
@@ -100,11 +101,14 @@ rspamd_control_finish_handler (struct rspamd_http_connection *conn,
struct ucl_parser *parser;
ucl_object_t *obj;
rspamd_fstring_t *out;
+ const gchar *body;
+ gsize body_len;
struct rspamadm_control_cbdata *cbdata = conn->ud;
+ body = rspamd_http_message_get_body (msg, &body_len);
parser = ucl_parser_new (0);
- if (!ucl_parser_add_chunk (parser, msg->body->str, msg->body->len)) {
+ if (!body || !ucl_parser_add_chunk (parser, body, body_len)) {
rspamd_fprintf (stderr, "cannot parse server's reply: %s\n",
ucl_parser_get_error (parser));
ucl_parser_free (parser);