diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-21 13:46:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-21 15:04:02 +0100 |
commit | 93d8da4d8519fb54d055873a3f6c317711de8e8f (patch) | |
tree | 323407efc86367b1e81d8259a19e7b71868cb934 /src/lua/lua_tcp.c | |
parent | d145c09388867031cff47e35bca74effd6c25fe8 (diff) | |
download | rspamd-93d8da4d8519fb54d055873a3f6c317711de8e8f.tar.gz rspamd-93d8da4d8519fb54d055873a3f6c317711de8e8f.zip |
Use new dns API.
Diffstat (limited to 'src/lua/lua_tcp.c')
-rw-r--r-- | src/lua/lua_tcp.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index 43e8cab7e..030f3109b 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -610,10 +610,19 @@ lua_tcp_request (lua_State *L) } } else { - if (!make_dns_request (resolver, session, NULL, lua_tcp_dns_handler, cbd, - RDNS_REQUEST_A, host)) { - lua_tcp_push_error (cbd, "cannot resolve host"); - lua_tcp_maybe_free (cbd); + if (task == NULL) { + if (!make_dns_request (resolver, session, NULL, lua_tcp_dns_handler, cbd, + RDNS_REQUEST_A, host)) { + lua_tcp_push_error (cbd, "cannot resolve host"); + lua_tcp_maybe_free (cbd); + } + } + else { + if (!make_dns_request_task (task, lua_tcp_dns_handler, cbd, + RDNS_REQUEST_A, host)) { + lua_tcp_push_error (cbd, "cannot resolve host"); + lua_tcp_maybe_free (cbd); + } } } |