diff -r b7d25e1ac716 -r e182b5029ef2 net/dns.lua --- a/net/dns.lua Wed Dec 02 22:15:17 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