aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-10-30 12:10:15 +0100
committerKim Alvefur <zash@zash.se>2014-10-30 12:10:15 +0100
commita5b90711b7e2638c4e735ec6545bea5b4462e9c4 (patch)
tree44764657dd2f1a2d2897eb5f7e1f918711af6697 /net
parentaac0915942b7d95b572e1d3a9e369ea84e935e2d (diff)
downloadprosody-a5b90711b7e2638c4e735ec6545bea5b4462e9c4.tar.gz
prosody-a5b90711b7e2638c4e735ec6545bea5b4462e9c4.zip
net.dns: Return new socket from servfail
Diffstat (limited to 'net')
-rw-r--r--net/dns.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/dns.lua b/net/dns.lua
index dc2da1b6..55622fc8 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -787,7 +787,7 @@ function resolver:servfail(sock)
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 @@ function resolver:servfail(sock)
--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 @@ function resolver:servfail(sock)
self.best_server = 1;
end
end
+ return sock;
end
function resolver:settimeout(seconds)