Software /
code /
prosody
Comparison
net/dns.lua @ 7469:363e4a5e9b0a
net.dns: remove unused one-letter loop variables [luacheck]
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 09 Jul 2016 00:45:59 +0800 |
parent | 7322:addf60d25356 |
child | 7480:3dc7de31d3d1 |
comparison
equal
deleted
inserted
replaced
7468:2d38a2519d09 | 7469:363e4a5e9b0a |
---|---|
188 | 188 |
189 | 189 |
190 local rrs_metatable = {}; -- - - - - - - - - - - - - - - - - - rrs_metatable | 190 local rrs_metatable = {}; -- - - - - - - - - - - - - - - - - - rrs_metatable |
191 function rrs_metatable.__tostring(rrs) | 191 function rrs_metatable.__tostring(rrs) |
192 local t = {}; | 192 local t = {}; |
193 for i,rr in ipairs(rrs) do | 193 for _, rr in ipairs(rrs) do |
194 append(t, tostring(rr)..'\n'); | 194 append(t, tostring(rr)..'\n'); |
195 end | 195 end |
196 return table.concat(t); | 196 return table.concat(t); |
197 end | 197 end |
198 | 198 |
839 --print('receive'); print(self.socket); | 839 --print('receive'); print(self.socket); |
840 self.time = socket.gettime(); | 840 self.time = socket.gettime(); |
841 rset = rset or self.socket; | 841 rset = rset or self.socket; |
842 | 842 |
843 local response; | 843 local response; |
844 for i,sock in pairs(rset) do | 844 for _, sock in pairs(rset) do |
845 | 845 |
846 if self.socketset[sock] then | 846 if self.socketset[sock] then |
847 local packet = sock:receive(); | 847 local packet = sock:receive(); |
848 if packet then | 848 if packet then |
849 response = self:decode(packet); | 849 response = self:decode(packet); |
850 if response and self.active[response.header.id] | 850 if response and self.active[response.header.id] |
851 and self.active[response.header.id][response.question.raw] then | 851 and self.active[response.header.id][response.question.raw] then |
852 --print('received response'); | 852 --print('received response'); |
853 --self.print(response); | 853 --self.print(response); |
854 | 854 |
855 for j,rr in pairs(response.answer) do | 855 for _, rr in pairs(response.answer) do |
856 if rr.name:sub(-#response.question[1].name, -1) == response.question[1].name then | 856 if rr.name:sub(-#response.question[1].name, -1) == response.question[1].name then |
857 self:remember(rr, response.question[1].type) | 857 self:remember(rr, response.question[1].type) |
858 end | 858 end |
859 end | 859 end |
860 | 860 |
892 if response and self.active[response.header.id] | 892 if response and self.active[response.header.id] |
893 and self.active[response.header.id][response.question.raw] then | 893 and self.active[response.header.id][response.question.raw] then |
894 --print('received response'); | 894 --print('received response'); |
895 --self.print(response); | 895 --self.print(response); |
896 | 896 |
897 for j,rr in pairs(response.answer) do | 897 for _, rr in pairs(response.answer) do |
898 self:remember(rr, response.question[1].type); | 898 self:remember(rr, response.question[1].type); |
899 end | 899 end |
900 | 900 |
901 -- retire the query | 901 -- retire the query |
902 local queries = self.active[response.header.id]; | 902 local queries = self.active[response.header.id]; |