Changeset

6508:4a28b8320d7f

net.dns: Return new socket from servfail
author Kim Alvefur <zash@zash.se>
date Thu, 30 Oct 2014 12:10:15 +0100
parents 6507:84ca02c6a47e
children 6509:7cb69eba3e95
files net/dns.lua
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/net/dns.lua	Thu Oct 30 12:08:05 2014 +0100
+++ b/net/dns.lua	Thu Oct 30 12:10:15 2014 +0100
@@ -787,7 +787,7 @@
 	local num = self.socketset[sock]
 
 	-- Socket is dead now
-	self:voidsocket(sock);
+	sock = self:voidsocket(sock);
 
 	-- Find all requests to the down server, and retry on the next server
 	self.time = socket.gettime();
@@ -804,8 +804,8 @@
 					--print('timeout');
 					queries[question] = nil;
 				else
-					local _a = self:getsocket(o.server);
-					if _a then _a:send(o.packet); end
+					sock = self:getsocket(o.server);
+					if sock then sock:send(o.packet); end
 				end
 			end
 		end
@@ -821,6 +821,7 @@
 			self.best_server = 1;
 		end
 	end
+	return sock;
 end
 
 function resolver:settimeout(seconds)