aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-19 17:16:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-19 17:16:31 +0100
commit94ae6e84e90880cb8d08c7202d20d64b03e437b1 (patch)
treef1130d9229fae94ef883c5d15025697a8a945246
parenta075b9aea725718499521b2adf5a273bfb863b7d (diff)
downloadrspamd-94ae6e84e90880cb8d08c7202d20d64b03e437b1.tar.gz
rspamd-94ae6e84e90880cb8d08c7202d20d64b03e437b1.zip
Fix issues with lua_tcp.
-rw-r--r--src/lua/lua_tcp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index a5fb6a882..2139a9d41 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -128,10 +128,6 @@ lua_tcp_push_data (struct lua_tcp_cbdata *cbd, const gchar *str, gsize len)
if (lua_pcall (cbd->L, 2, 0, 0) != 0) {
msg_info ("callback call failed: %s", lua_tostring (cbd->L, -1));
}
-
- if (!cbd->partial) {
- lua_tcp_maybe_free (cbd);
- }
}
static void
@@ -303,6 +299,8 @@ lua_tcp_dns_handler (struct rdns_reply *reply, gpointer ud)
&reply->entries->content.aaa.addr);
}
+ rspamd_inet_address_set_port (cbd->addr, cbd->port);
+
if (!lua_tcp_make_connection (cbd)) {
lua_tcp_push_error (cbd, "unable to make connection to the host");
lua_tcp_maybe_free (cbd);
@@ -360,7 +358,7 @@ lua_tcp_request (lua_State *L)
gboolean partial = FALSE;
if (lua_type (L, 1) == LUA_TTABLE) {
- lua_pushstring (L, "url");
+ lua_pushstring (L, "host");
lua_gettable (L, -2);
host = luaL_checkstring (L, -1);
lua_pop (L, 1);
@@ -520,6 +518,7 @@ lua_tcp_request (lua_State *L)
cbd->iovlen = niov;
cbd->total = total_out;
cbd->pos = 0;
+ cbd->port = port;
if (session) {
cbd->session = session;