Comparison

net/dns.lua @ 3512:e344b00f2cc9

net.dns: Add 'force' parameter to resolver:feed() to force decoding a packet even if it doesn't match an outstanding request
author Matthew Wild <mwild1@gmail.com>
date Tue, 05 Oct 2010 18:55:17 +0100
parent 3360:6c07b64e972c
child 3513:4cf5962747fc
comparison
equal deleted inserted replaced
3511:4495403470cb 3512:e344b00f2cc9
796 796
797 return response; 797 return response;
798 end 798 end
799 799
800 800
801 function resolver:feed(sock, packet) 801 function resolver:feed(sock, packet, force)
802 --print('receive'); print(self.socket); 802 --print('receive'); print(self.socket);
803 self.time = socket.gettime(); 803 self.time = socket.gettime();
804 804
805 local response = self:decode(packet); 805 local response = self:decode(packet, force);
806 if response and self.active[response.header.id] 806 if response and self.active[response.header.id]
807 and self.active[response.header.id][response.question.raw] then 807 and self.active[response.header.id][response.question.raw] then
808 --print('received response'); 808 --print('received response');
809 --self.print(response); 809 --self.print(response);
810 810