Changeset

3049:e54774bd73a7

net/dns: Fix socket.select timeout.
author Brian Cully <bjc@junctionnetworks.com>
date Mon, 28 Dec 2009 19:49:55 +0500
parents 3047:820ae39e06de
children 3051:15150ad771df
files net/dns.lua
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/net/dns.lua	Tue May 18 00:47:06 2010 +0100
+++ b/net/dns.lua	Mon Dec 28 19:49:55 2009 +0500
@@ -851,7 +851,14 @@
 
 function resolver:lookup(qname, qtype, qclass)    -- - - - - - - - - -  lookup
 	self:query (qname, qtype, qclass)
-	while self:pulse() do socket.select(self.socket, nil, 4); end
+	while self:pulse() do
+           local recvt = {}
+           local i, s
+           for i, s in ipairs(self.socket) do
+              recvt[i] = s.socket()
+           end
+           socket.select(recvt, nil, 4)
+        end
 	--print(self.cache);
 	return self:peek(qname, qtype, qclass);
 end