Comparison

net/dns.lua @ 6863:88d54bec26b7

net.dns: Unconditionally cache records found in answers
author Matthew Wild <mwild1@gmail.com>
date Mon, 25 May 2015 23:16:11 +0100
parent 6645:4f934cf03bc9
child 6866:abff7543b79c
child 7054:94d5e2f33a10
comparison
equal deleted inserted replaced
6797:509b70437035 6863:88d54bec26b7
853 and self.active[response.header.id][response.question.raw] then 853 and self.active[response.header.id][response.question.raw] then
854 --print('received response'); 854 --print('received response');
855 --self.print(response); 855 --self.print(response);
856 856
857 for j,rr in pairs(response.answer) do 857 for j,rr in pairs(response.answer) do
858 if rr.name:sub(-#response.question[1].name, -1) == response.question[1].name then 858 self:remember(rr, response.question[1].type)
859 self:remember(rr, response.question[1].type)
860 end
861 end 859 end
862 860
863 -- retire the query 861 -- retire the query
864 local queries = self.active[response.header.id]; 862 local queries = self.active[response.header.id];
865 queries[response.question.raw] = nil; 863 queries[response.question.raw] = nil;