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/lua/lua_http.c | |
parent | dbfdd2bf45134a467fed1e625c7bcbe93f199e24 (diff) | |
download | rspamd-3a1974cf17f235b7bbb98de714fe0210ddb2c596.tar.gz rspamd-3a1974cf17f235b7bbb98de714fe0210ddb2c596.zip |
[Rework] Another iteration of HTTP interfaces rework
Diffstat (limited to 'src/lua/lua_http.c')
-rw-r--r-- | src/lua/lua_http.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index e518e6dab..19cf8f2c9 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -368,8 +368,6 @@ lua_http_resume_handler (struct rspamd_http_connection *conn, static gboolean lua_http_make_connection (struct lua_http_cbdata *cbd) { - int fd; - rspamd_inet_address_set_port (cbd->addr, cbd->msg->port); if (cbd->flags & RSPAMD_LUA_HTTP_FLAG_KEEP_ALIVE) { @@ -384,22 +382,14 @@ lua_http_make_connection (struct lua_http_cbdata *cbd) cbd->host); } else { - fd = rspamd_inet_address_connect (cbd->addr, SOCK_STREAM, TRUE); - - if (fd == -1) { - msg_info ("cannot connect to %V", cbd->msg->host); - return FALSE; - } - - cbd->fd = fd; - cbd->conn = rspamd_http_connection_new ( + cbd->fd = -1; + cbd->conn = rspamd_http_connection_new_client ( NULL, /* Default context */ - fd, NULL, lua_http_error_handler, lua_http_finish_handler, RSPAMD_HTTP_CLIENT_SIMPLE, - RSPAMD_HTTP_CLIENT); + cbd->addr); } if (cbd->conn) { |