Software /
code /
prosody
Comparison
net/dns.lua @ 6753:33426c56f5d5
net.dns: Remove resolver:new(), as it needlessly and incorrectly duplicates dns.resolver()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 06 Jul 2015 19:11:39 +0100 |
parent | 6646:9795b8cf14f1 |
child | 6780:647adfd8f738 |
comparison
equal
deleted
inserted
replaced
6752:3cc2bc9c1bff | 6753:33426c56f5d5 |
---|---|
208 append(t, tostring(rrs)); | 208 append(t, tostring(rrs)); |
209 end | 209 end |
210 end | 210 end |
211 end | 211 end |
212 return table.concat(t); | 212 return table.concat(t); |
213 end | |
214 | |
215 | |
216 function resolver:new() -- - - - - - - - - - - - - - - - - - - - - resolver | |
217 local r = { active = {}, cache = {}, unsorted = {} }; | |
218 setmetatable(r, resolver); | |
219 setmetatable(r.cache, cache_metatable); | |
220 setmetatable(r.unsorted, { __mode = 'kv' }); | |
221 return r; | |
222 end | 213 end |
223 | 214 |
224 | 215 |
225 -- packet layer -------------------------------------------------- packet layer | 216 -- packet layer -------------------------------------------------- packet layer |
226 | 217 |
1052 | 1043 |
1053 -- module api ------------------------------------------------------ module api | 1044 -- module api ------------------------------------------------------ module api |
1054 | 1045 |
1055 | 1046 |
1056 function dns.resolver () -- - - - - - - - - - - - - - - - - - - - - resolver | 1047 function dns.resolver () -- - - - - - - - - - - - - - - - - - - - - resolver |
1057 -- this function seems to be redundant with resolver.new () | |
1058 | |
1059 local r = { active = {}, cache = {}, unsorted = {}, wanted = {}, best_server = 1 }; | 1048 local r = { active = {}, cache = {}, unsorted = {}, wanted = {}, best_server = 1 }; |
1060 setmetatable (r, resolver); | 1049 setmetatable (r, resolver); |
1061 setmetatable (r.cache, cache_metatable); | 1050 setmetatable (r.cache, cache_metatable); |
1062 setmetatable (r.unsorted, { __mode = 'kv' }); | 1051 setmetatable (r.unsorted, { __mode = 'kv' }); |
1063 return r; | 1052 return r; |