aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_tcp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-26 17:09:58 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-26 17:09:58 +0100
commit856cb10ddaeb0db71dfe5bee6e700c3cf08f4fab (patch)
treeb9e3f68f643ed622d2321f9a8ce0ebdd529f9c1d /src/lua/lua_tcp.c
parenta821e3c6d98648455e0f8968453a885a18d9ebc4 (diff)
downloadrspamd-856cb10ddaeb0db71dfe5bee6e700c3cf08f4fab.tar.gz
rspamd-856cb10ddaeb0db71dfe5bee6e700c3cf08f4fab.zip
[Minor] Various fixes around async events
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r--src/lua/lua_tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index 375867df6..8d657b466 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -1205,6 +1205,7 @@ lua_tcp_make_connection (struct lua_tcp_cbdata *cbd)
return FALSE;
}
+#if 0
if (!(cbd->flags & LUA_TCP_FLAG_RESOLVED)) {
/* We come here without resolving, so we need to add a watcher */
lua_tcp_register_watcher (cbd);
@@ -1212,6 +1213,7 @@ lua_tcp_make_connection (struct lua_tcp_cbdata *cbd)
else {
cbd->flags |= LUA_TCP_FLAG_RESOLVED;
}
+#endif
lua_tcp_register_event (cbd);
@@ -1637,6 +1639,8 @@ lua_tcp_request (lua_State *L)
if (rspamd_parse_inet_address (&cbd->addr, host, 0)) {
rspamd_inet_address_set_port (cbd->addr, port);
/* Host is numeric IP, no need to resolve */
+ lua_tcp_register_watcher (cbd);
+
if (!lua_tcp_make_connection (cbd)) {
lua_pushboolean (L, FALSE);
@@ -1829,6 +1833,8 @@ lua_tcp_connect_sync (lua_State *L)
}
}
else {
+ cbd->item = rspamd_symbols_cache_get_cur_item (task);
+
if (!make_dns_request_task (task, lua_tcp_dns_handler, cbd,
RDNS_REQUEST_A, host)) {
lua_pushboolean (L, FALSE);