Software /
code /
prosody
Comparison
net/dns.lua @ 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 |
parent | 2081:b9bbb709d62e |
child | 2278:8c10f13c0c20 |
child | 2762:2bddf8b766f7 |
child | 2856:70e6ea49aff3 |
comparison
equal
deleted
inserted
replaced
2081:b9bbb709d62e | 2082:1381b2071c2e |
---|---|
729 if response and self.active[response.header.id] | 729 if response and self.active[response.header.id] |
730 and self.active[response.header.id][response.question.raw] then | 730 and self.active[response.header.id][response.question.raw] then |
731 --print('received response'); | 731 --print('received response'); |
732 --self.print(response); | 732 --self.print(response); |
733 | 733 |
734 for i,section in pairs({ 'answer', 'authority', 'additional' }) do | 734 for j,rr in pairs(response.answer) do |
735 for j,rr in pairs(response[section]) do | 735 if rr.name:sub(-#response.question[1].name, -1) == response.question[1].name then |
736 self:remember(rr, response.question[1].type) | 736 self:remember(rr, response.question[1].type) |
737 end | 737 end |
738 end | 738 end |
739 | 739 |
740 -- retire the query | 740 -- retire the query |
741 local queries = self.active[response.header.id]; | 741 local queries = self.active[response.header.id]; |
742 if queries[response.question.raw] then | 742 queries[response.question.raw] = nil; |
743 queries[response.question.raw] = nil; | 743 |
744 end | |
745 if not next(queries) then self.active[response.header.id] = nil; end | 744 if not next(queries) then self.active[response.header.id] = nil; end |
746 if not next(self.active) then self:closeall(); end | 745 if not next(self.active) then self:closeall(); end |
747 | 746 |
748 -- was the query on the wanted list? | 747 -- was the query on the wanted list? |
749 local q = response.question; | 748 local q = response.question; |