aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-19 17:53:52 +0100
committerTobias Markmann <tm@ayena.de>2009-11-19 17:53:52 +0100
commit55df1de9bdfac703203e5659bb7cf172760ef484 (patch)
treee65da676bceabba8ad622a2b6d3c28b8f5d0953a /net/dns.lua
parent315e7ac799abb96f627be4c5b27648f007b89be7 (diff)
parent4cac67d580f99530cd401f4b9b7e7f2036697ada (diff)
downloadprosody-55df1de9bdfac703203e5659bb7cf172760ef484.tar.gz
prosody-55df1de9bdfac703203e5659bb7cf172760ef484.zip
Merge with trunk.
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 04b2cf22..c50e893c 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -726,21 +726,21 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive
local packet = sock:receive();
if packet then
response = self:decode(packet);
- if response then
+ if response and self.active[response.header.id]
+ and self.active[response.header.id][response.question.raw] then
--print('received response');
--self.print(response);
- for i,section in pairs({ 'answer', 'authority', 'additional' }) do
- for j,rr in pairs(response[section]) do
+ for j,rr in pairs(response.answer) do
+ if rr.name:sub(-#response.question[1].name, -1) == response.question[1].name then
self:remember(rr, response.question[1].type)
end
end
-- retire the query
local queries = self.active[response.header.id];
- if queries[response.question.raw] then
- queries[response.question.raw] = nil;
- end
+ queries[response.question.raw] = nil;
+
if not next(queries) then self.active[response.header.id] = nil; end
if not next(self.active) then self:closeall(); end