Software /
code /
prosody
Changeset
2762:2bddf8b766f7
net.dns: Port some DNS fixes to the resolver:feed() function for net.adns to use
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 03 Dec 2009 01:10:08 +0000 |
parents | 2761:5d3ad9a6b3be |
children | 2763:083430330585 |
files | net/dns.lua |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/net/dns.lua Wed Dec 02 18:02:47 2009 +0000 +++ b/net/dns.lua Thu Dec 03 01:10:08 2009 +0000 @@ -768,21 +768,18 @@ self.time = socket.gettime(); local 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 - self:remember(rr, response.question[1].type); - end + for j,rr in pairs(response.answer) do + self:remember(rr, response.question[1].type); 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