Browse Source

[Minor] Adopt Rspamd to flags in rdns reply

tags/3.2
Vsevolod Stakhov 2 years ago
parent
commit
e0f1732a97
2 changed files with 6 additions and 3 deletions
  1. 4
    1
      src/lua/lua_dns.c
  2. 2
    2
      src/lua/lua_dns_resolver.c

+ 4
- 1
src/lua/lua_dns.c View File

@@ -166,9 +166,12 @@ lua_dns_callback (struct rdns_reply *reply, void *arg)
else {
lua_push_dns_reply (L, reply);

lua_pushboolean (L, reply->authenticated);
lua_pushboolean (L, reply->flags & RDNS_AUTH);
lua_setfield (L, -3, "authenticated");

lua_pushboolean (L, reply->flags & RDNS_TRUNCATED);
lua_setfield (L, -3, "truncated");

/* result 1 - not and error */
lua_pushboolean (L, true);
/* push table into stack, result 2 - results itself */

+ 2
- 2
src/lua/lua_dns_resolver.c View File

@@ -169,7 +169,7 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg)
* 3 - entries | nil
* 4 - error | nil
* 5 - user_str
* 6 - reply->authenticated
* 6 - reply->flags & RDNS_AUTH
* 7 - server
*/
if (reply->code != RDNS_RC_NOERROR) {
@@ -183,7 +183,7 @@ lua_dns_resolver_callback (struct rdns_reply *reply, gpointer arg)
lua_pushnil (L);
}

lua_pushboolean (L, reply->authenticated);
lua_pushboolean (L, reply->flags & RDNS_AUTH);

const gchar *servname = rdns_request_get_server (reply->request);


Loading…
Cancel
Save