aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/rspamdclient.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/rspamdclient.c')
-rw-r--r--src/client/rspamdclient.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c
index d386664dc..5932da38b 100644
--- a/src/client/rspamdclient.c
+++ b/src/client/rspamdclient.c
@@ -14,8 +14,9 @@
* limitations under the License.
*/
#include "rspamdclient.h"
-#include "util.h"
-#include "http.h"
+#include "libutil/util.h"
+#include "libutil/http.h"
+#include "libutil/http_private.h"
#include "unix-std.h"
#ifdef HAVE_FETCH_H
@@ -115,7 +116,7 @@ rspamd_client_finish_handler (struct rspamd_http_connection *conn,
return 0;
}
else {
- if (msg->body == NULL || msg->body_buf.len == 0 || msg->code != 200) {
+ if (rspamd_http_message_get_body (msg, NULL) == NULL || msg->code != 200) {
err = g_error_new (RCLIENT_ERROR, msg->code, "HTTP error: %d, %.*s",
msg->code,
(gint)msg->status->len, msg->status->str);
@@ -205,6 +206,7 @@ rspamd_client_command (struct rspamd_client_connection *conn,
gsize remain, old_len;
GList *cur;
GString *input = NULL;
+ rspamd_fstring_t *body;
req = g_slice_alloc0 (sizeof (struct rspamd_client_request));
req->conn = conn;
@@ -243,11 +245,11 @@ rspamd_client_command (struct rspamd_client_connection *conn,
return FALSE;
}
- req->msg->body = rspamd_fstring_new_init (input->str, input->len);
+ body = rspamd_fstring_new_init (input->str, input->len);
+ rspamd_http_message_set_body_from_fstring_steal (req->msg, body);
req->input = input;
}
else {
- req->msg->body = NULL;
req->input = NULL;
}