Software /
code /
prosody
Comparison
net/dns.lua @ 6310:d232bb1bbe1e
net.dns: Remove unused obsolete code
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 25 Jul 2014 12:54:31 +0100 |
parent | 6309:b6f76a52eb36 |
child | 6312:1940a014aeca |
child | 6463:460584257cc9 |
comparison
equal
deleted
inserted
replaced
6309:b6f76a52eb36 | 6310:d232bb1bbe1e |
---|---|
743 self.active[id][question] = o; | 743 self.active[id][question] = o; |
744 | 744 |
745 -- remember which coroutine wants the answer | 745 -- remember which coroutine wants the answer |
746 if co then | 746 if co then |
747 set(self.wanted, qclass, qtype, qname, co, true); | 747 set(self.wanted, qclass, qtype, qname, co, true); |
748 --set(self.yielded, co, qclass, qtype, qname, true); | |
749 end | 748 end |
750 | 749 |
751 local conn, err = self:getsocket(o.server) | 750 local conn, err = self:getsocket(o.server) |
752 if not conn then | 751 if not conn then |
753 return nil, err; | 752 return nil, err; |
856 -- was the query on the wanted list? | 855 -- was the query on the wanted list? |
857 local q = response.question[1]; | 856 local q = response.question[1]; |
858 local cos = get(self.wanted, q.class, q.type, q.name); | 857 local cos = get(self.wanted, q.class, q.type, q.name); |
859 if cos then | 858 if cos then |
860 for co in pairs(cos) do | 859 for co in pairs(cos) do |
861 set(self.yielded, co, q.class, q.type, q.name, nil); | |
862 if coroutine.status(co) == "suspended" then coroutine.resume(co); end | 860 if coroutine.status(co) == "suspended" then coroutine.resume(co); end |
863 end | 861 end |
864 set(self.wanted, q.class, q.type, q.name, nil); | 862 set(self.wanted, q.class, q.type, q.name, nil); |
865 end | 863 end |
866 end | 864 end |
897 local q = response.question[1]; | 895 local q = response.question[1]; |
898 if q then | 896 if q then |
899 local cos = get(self.wanted, q.class, q.type, q.name); | 897 local cos = get(self.wanted, q.class, q.type, q.name); |
900 if cos then | 898 if cos then |
901 for co in pairs(cos) do | 899 for co in pairs(cos) do |
902 set(self.yielded, co, q.class, q.type, q.name, nil); | |
903 if coroutine.status(co) == "suspended" then coroutine.resume(co); end | 900 if coroutine.status(co) == "suspended" then coroutine.resume(co); end |
904 end | 901 end |
905 set(self.wanted, q.class, q.type, q.name, nil); | 902 set(self.wanted, q.class, q.type, q.name, nil); |
906 end | 903 end |
907 end | 904 end |
1035 | 1032 |
1036 | 1033 |
1037 function dns.resolver () -- - - - - - - - - - - - - - - - - - - - - resolver | 1034 function dns.resolver () -- - - - - - - - - - - - - - - - - - - - - resolver |
1038 -- this function seems to be redundant with resolver.new () | 1035 -- this function seems to be redundant with resolver.new () |
1039 | 1036 |
1040 local r = { active = {}, cache = {}, unsorted = {}, wanted = {}, yielded = {}, best_server = 1 }; | 1037 local r = { active = {}, cache = {}, unsorted = {}, wanted = {}, best_server = 1 }; |
1041 setmetatable (r, resolver); | 1038 setmetatable (r, resolver); |
1042 setmetatable (r.cache, cache_metatable); | 1039 setmetatable (r.cache, cache_metatable); |
1043 setmetatable (r.unsorted, { __mode = 'kv' }); | 1040 setmetatable (r.unsorted, { __mode = 'kv' }); |
1044 return r; | 1041 return r; |
1045 end | 1042 end |