diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-02-19 17:29:23 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-02-19 17:29:23 +0000 |
commit | 5b78ecce464ef90e4794ed3c6f1d0dcfd5ed2e83 (patch) | |
tree | f547db2872ebf1490d1a356b436b225496bb7a5c /src/lua/lua_dns.c | |
parent | c73632361af0ec1faea773257b4b8764713cb169 (diff) | |
download | rspamd-5b78ecce464ef90e4794ed3c6f1d0dcfd5ed2e83.tar.gz rspamd-5b78ecce464ef90e4794ed3c6f1d0dcfd5ed2e83.zip |
Integrate rspamd with librdns.
Diffstat (limited to 'src/lua/lua_dns.c')
-rw-r--r-- | src/lua/lua_dns.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lua/lua_dns.c b/src/lua/lua_dns.c index 2bfbe582f..b3d8f768f 100644 --- a/src/lua/lua_dns.c +++ b/src/lua/lua_dns.c @@ -66,12 +66,12 @@ struct lua_dns_cbdata { }; static void -lua_dns_callback (struct rspamd_dns_reply *reply, gpointer arg) +lua_dns_callback (struct rdns_reply *reply, gpointer arg) { struct lua_dns_cbdata *cd = arg; gint i = 0; struct rspamd_dns_resolver **presolver; - struct rspamd_reply_entry *elt; + struct rdns_reply_entry *elt; lua_rawgeti (cd->L, LUA_REGISTRYINDEX, cd->cbref); presolver = lua_newuserdata (cd->L, sizeof (gpointer)); @@ -86,13 +86,6 @@ lua_dns_callback (struct rspamd_dns_reply *reply, gpointer arg) if (reply->code == DNS_RC_NOERROR) { lua_newtable (cd->L); LL_FOREACH (reply->entries, elt) { - if (elt->type != reply->request->type) { - /* - * XXX: Skip additional record here to be compatible - * with the existing plugins - */ - continue; - } switch (elt->type) { case DNS_REQUEST_A: lua_ip_push (cd->L, AF_INET, &elt->content.a.addr); @@ -127,7 +120,7 @@ lua_dns_callback (struct rspamd_dns_reply *reply, gpointer arg) } else { lua_pushnil (cd->L); - lua_pushstring (cd->L, dns_strerror (reply->code)); + lua_pushstring (cd->L, rdns_strerror (reply->code)); } if (cd->user_str != NULL) { @@ -179,7 +172,8 @@ lua_dns_resolver_init (lua_State *L) } static int -lua_dns_resolver_resolve_common (lua_State *L, struct rspamd_dns_resolver *resolver, enum rspamd_request_type type) +lua_dns_resolver_resolve_common (lua_State *L, struct rspamd_dns_resolver *resolver, + enum rdns_request_type type) { struct rspamd_async_session *session, **psession; memory_pool_t *pool, **ppool; |