Software /
code /
prosody
Changeset
2082:1381b2071c2e
net.dns: Be more strict about the records we cache
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 18 Nov 2009 01:09:09 +0000 |
parents | 2081:b9bbb709d62e |
children | 2083:47bfc69fb2d2 |
files | net/dns.lua |
diffstat | 1 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/net/dns.lua Wed Nov 18 01:05:38 2009 +0000 +++ b/net/dns.lua Wed Nov 18 01:09:09 2009 +0000 @@ -731,17 +731,16 @@ --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