Comparison

net/dns.lua @ 3540:bc139431830b

Monster whitespace commit (beware the whitespace monster).
author Waqas Hussain <waqas20@gmail.com>
date Sat, 16 Oct 2010 23:00:42 +0500
parent 3513:4cf5962747fc
child 3544:f2aca3e0fe3b
comparison
equal deleted inserted replaced
3539:8bbd965267b2 3540:bc139431830b
672 server = self.best_server, 672 server = self.best_server,
673 delay = 1, 673 delay = 1,
674 retry = socket.gettime() + self.delays[1] 674 retry = socket.gettime() + self.delays[1]
675 }; 675 };
676 676
677 -- remember the query 677 -- remember the query
678 self.active[id] = self.active[id] or {}; 678 self.active[id] = self.active[id] or {};
679 self.active[id][question] = o; 679 self.active[id][question] = o;
680 680
681 -- remember which coroutine wants the answer 681 -- remember which coroutine wants the answer
682 local co = coroutine.running(); 682 local co = coroutine.running();
683 if co then 683 if co then
684 set(self.wanted, qclass, qtype, qname, co, true); 684 set(self.wanted, qclass, qtype, qname, co, true);
685 --set(self.yielded, co, qclass, qtype, qname, true); 685 --set(self.yielded, co, qclass, qtype, qname, true);
686 end 686 end
736 if _a then _a:send(o.packet); end 736 if _a then _a:send(o.packet); end
737 end 737 end
738 end 738 end
739 end 739 end
740 end 740 end
741 741
742 if num == self.best_server then 742 if num == self.best_server then
743 self.best_server = self.best_server + 1; 743 self.best_server = self.best_server + 1;
744 if self.best_server > #self.server then 744 if self.best_server > #self.server then
745 -- Exhausted all servers, try first again 745 -- Exhausted all servers, try first again
746 self.best_server = 1; 746 self.best_server = 1;
885 885
886 886
887 function resolver:lookup(qname, qtype, qclass) -- - - - - - - - - - lookup 887 function resolver:lookup(qname, qtype, qclass) -- - - - - - - - - - lookup
888 self:query (qname, qtype, qclass) 888 self:query (qname, qtype, qclass)
889 while self:pulse() do 889 while self:pulse() do
890 local recvt = {} 890 local recvt = {}
891 for i, s in ipairs(self.socket) do 891 for i, s in ipairs(self.socket) do
892 recvt[i] = s 892 recvt[i] = s
893 end 893 end
894 socket.select(recvt, nil, 4) 894 socket.select(recvt, nil, 4)
895 end 895 end
896 --print(self.cache); 896 --print(self.cache);
897 return self:peek(qname, qtype, qclass); 897 return self:peek(qname, qtype, qclass);
898 end 898 end
899 899
900 function resolver:lookupex(handler, qname, qtype, qclass) -- - - - - - - - - - lookup 900 function resolver:lookupex(handler, qname, qtype, qclass) -- - - - - - - - - - lookup