aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-11-18 01:09:09 +0000
committerMatthew Wild <mwild1@gmail.com>2009-11-18 01:09:09 +0000
commit38fe146c0509a615a8f201c9fa5814178cb8b918 (patch)
tree4be1f8acba3732d90544a8c11b0f82b56201c8b0 /net/dns.lua
parent911cb9d48898a35652e0e8ae53a7b5459522431d (diff)
downloadprosody-38fe146c0509a615a8f201c9fa5814178cb8b918.tar.gz
prosody-38fe146c0509a615a8f201c9fa5814178cb8b918.zip
net.dns: Be more strict about the records we cache
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 5d5f512f..c50e893c 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -731,17 +731,16 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive
--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