diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-18 12:00:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-03-18 12:00:00 +0000 |
commit | 3a1974cf17f235b7bbb98de714fe0210ddb2c596 (patch) | |
tree | 7168784fff3f9d8b9bc19301cc34278218d4cd57 /src/rspamadm | |
parent | dbfdd2bf45134a467fed1e625c7bcbe93f199e24 (diff) | |
download | rspamd-3a1974cf17f235b7bbb98de714fe0210ddb2c596.tar.gz rspamd-3a1974cf17f235b7bbb98de714fe0210ddb2c596.zip |
[Rework] Another iteration of HTTP interfaces rework
Diffstat (limited to 'src/rspamadm')
-rw-r--r-- | src/rspamadm/control.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/rspamadm/control.c b/src/rspamadm/control.c index 0a242e943..1311622c3 100644 --- a/src/rspamadm/control.c +++ b/src/rspamadm/control.c @@ -175,7 +175,6 @@ rspamadm_control (gint argc, gchar **argv, const struct rspamadm_command *_cmd) rspamd_inet_addr_t *addr; struct timeval tv; static struct rspamadm_control_cbdata cbdata; - gint sock; context = g_option_context_new ( "control - manage rspamd main control interface"); @@ -230,22 +229,14 @@ rspamadm_control (gint argc, gchar **argv, const struct rspamadm_command *_cmd) exit (1); } - sock = rspamd_inet_address_connect (addr, SOCK_STREAM, TRUE); - if (sock == -1) { - rspamd_fprintf (stderr, "cannot connect to: %s\n", control_path); - rspamd_inet_address_free (addr); - exit (1); - } - - conn = rspamd_http_connection_new ( + conn = rspamd_http_connection_new_client ( rspamd_main->http_ctx, /* Default context */ - sock, NULL, rspamd_control_error_handler, rspamd_control_finish_handler, RSPAMD_HTTP_CLIENT_SIMPLE, - RSPAMD_HTTP_CLIENT); + addr); msg = rspamd_http_new_message (HTTP_REQUEST); msg->url = rspamd_fstring_new_init (path, strlen (path)); double_to_tv (timeout, &tv); @@ -261,5 +252,4 @@ rspamadm_control (gint argc, gchar **argv, const struct rspamadm_command *_cmd) rspamd_http_connection_unref (conn); rspamd_inet_address_free (addr); - close (sock); } |