aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-10 17:37:06 +0200
committerKim Alvefur <zash@zash.se>2018-06-10 17:37:06 +0200
commit28e486f3df0f239d65a6ae771b43c92869a8f275 (patch)
tree9b641ba996ece9b3cdef763127a5a8101ca0cfdc /net/dns.lua
parentb7fc41affc5f5ae2f726b3c17e89fc7deb6b81f7 (diff)
downloadprosody-28e486f3df0f239d65a6ae771b43c92869a8f275.tar.gz
prosody-28e486f3df0f239d65a6ae771b43c92869a8f275.zip
Backed out changeset eae606b9266c: Used a lot of memory
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 0d2cce01..8a7d4e7a 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -86,10 +86,9 @@ local function highbyte(i) -- - - - - - - - - - - - - - - - - - - highbyte
end
-local function augment (t, prefix) -- - - - - - - - - - - - - - - - - augment
+local function augment (t) -- - - - - - - - - - - - - - - - - - - - augment
local a = {};
- for i = 1, 0xffff do
- local s = t[i] or ("%s%d"):format(prefix, i);
+ for i,s in pairs(t) do
a[i] = s;
a[s] = s;
a[string.lower(s)] = s;
@@ -120,8 +119,8 @@ dns.types = {
dns.classes = { 'IN', 'CS', 'CH', 'HS', [255] = '*' };
-dns.type = augment (dns.types, "TYPE");
-dns.class = augment (dns.classes, "CLASS");
+dns.type = augment (dns.types);
+dns.class = augment (dns.classes);
dns.typecode = encode (dns.types);
dns.classcode = encode (dns.classes);