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 /utils | |
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 'utils')
-rw-r--r-- | utils/rspamd_http_bench.c | 3 | ||||
-rw-r--r-- | utils/rspamd_http_server.c | 13 |
2 files changed, 11 insertions, 5 deletions
diff --git a/utils/rspamd_http_bench.c b/utils/rspamd_http_bench.c index c9a752243..64b4e6ed2 100644 --- a/utils/rspamd_http_bench.c +++ b/utils/rspamd_http_bench.c @@ -16,7 +16,8 @@ #include "config.h" #include "rspamd.h" #include "util.h" -#include "http.h" +#include "libutil/http.h" +#include "libutil/http_private.h" #include "ottery.h" #include "cryptobox.h" #include "unix-std.h" diff --git a/utils/rspamd_http_server.c b/utils/rspamd_http_server.c index 9af96fad9..d920c425d 100644 --- a/utils/rspamd_http_server.c +++ b/utils/rspamd_http_server.c @@ -16,7 +16,9 @@ #include "config.h" #include "rspamd.h" #include "util.h" -#include "http.h" +#include "libutil/fstring.h" +#include "libutil/http.h" +#include "libutil/http_private.h" #include "ottery.h" #include "cryptobox.h" #include "keypair.h" @@ -83,6 +85,7 @@ rspamd_server_finish (struct rspamd_http_connection *conn, gulong size; const gchar *url_str; guint url_len; + rspamd_fstring_t *body; if (!session->reply) { session->reply = TRUE; @@ -100,9 +103,11 @@ rspamd_server_finish (struct rspamd_http_connection *conn, reply->code = 200; reply->status = rspamd_fstring_new_init ("OK", 2); - reply->body = rspamd_fstring_sized_new (size); - reply->body->len = size; - memset (reply->body->str, 0, size); + body = rspamd_fstring_sized_new (size); + body->len = size; + memset (body->str, 0, size); + rspamd_http_message_set_body_from_fstring_steal (msg, body); + } else { reply->code = 404; |