diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-11 21:36:38 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-08-11 21:36:38 +0100 |
commit | b8456ec01d76b1c0fb3e50182d12f3cfcacade51 (patch) | |
tree | a7ccafb56c48160531f214844d3b06bf587098a6 | |
parent | a28a06159b49af6dc90d97d0b3bbf82581081282 (diff) | |
download | rspamd-b8456ec01d76b1c0fb3e50182d12f3cfcacade51.tar.gz rspamd-b8456ec01d76b1c0fb3e50182d12f3cfcacade51.zip |
[Minor] Remove duplicated code
-rw-r--r-- | src/lua/lua_dns_resolver.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c index cbdb06641..9a9201f0e 100644 --- a/src/lua/lua_dns_resolver.c +++ b/src/lua/lua_dns_resolver.c @@ -109,28 +109,7 @@ lua_dns_get_type (lua_State *L, int argno) } else { strtype = lua_tostring (L, argno); - - if (g_ascii_strcasecmp (strtype, "a") == 0) { - type = RDNS_REQUEST_A; - } - else if (g_ascii_strcasecmp (strtype, "aaaa") == 0) { - type = RDNS_REQUEST_AAAA; - } - else if (g_ascii_strcasecmp (strtype, "mx") == 0) { - type = RDNS_REQUEST_MX; - } - else if (g_ascii_strcasecmp (strtype, "txt") == 0) { - type = RDNS_REQUEST_TXT; - } - else if (g_ascii_strcasecmp (strtype, "ptr") == 0) { - type = RDNS_REQUEST_PTR; - } - else if (g_ascii_strcasecmp (strtype, "soa") == 0) { - type = RDNS_REQUEST_SOA; - } - else { - msg_err ("bad DNS type: %s", strtype); - } + type = rdns_type_fromstr (strtype); } return type; |