diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-10 16:38:29 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-10 16:38:29 +0100 |
commit | 5bbd698d9649a09e1992caef99b1482c62a5a54f (patch) | |
tree | 3c9032073c44c175b3009e99a30408c1693defe0 /src/client/rspamdclient.c | |
parent | de6e99a081384da39d119e15375febf0028cea9d (diff) | |
download | rspamd-5bbd698d9649a09e1992caef99b1482c62a5a54f.tar.gz rspamd-5bbd698d9649a09e1992caef99b1482c62a5a54f.zip |
[Rework] Finish rework for the rest of places that use HTTP
Diffstat (limited to 'src/client/rspamdclient.c')
-rw-r--r-- | src/client/rspamdclient.c | 12 |
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; } |