aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-07-25 12:08:07 +0100
committerMatthew Wild <mwild1@gmail.com>2014-07-25 12:08:07 +0100
commit4ed07e7947ed559ae1b97d031351b5874156eec0 (patch)
treeb19fa60934360ab841326494a7ffe453fecd60e3 /net
parent01b960044e60a7b544e83640a3c1e68fb06b15fd (diff)
downloadprosody-4ed07e7947ed559ae1b97d031351b5874156eec0.tar.gz
prosody-4ed07e7947ed559ae1b97d031351b5874156eec0.zip
net.dns: Ensure all pending requests get notified of a timeout when looking up a record (fix for d122420542fb)
Diffstat (limited to 'net')
-rw-r--r--net/dns.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 492bd1c5..906365ce 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -770,7 +770,7 @@ function resolver:query(qname, qtype, qclass) -- - - - - - - - - - -- query
end
end
-- Tried everything, failed
- self:cancel(qclass, qtype, qname, co, true);
+ self:cancel(qclass, qtype, qname);
end
end)
end
@@ -910,13 +910,13 @@ function resolver:feed(sock, packet, force)
return response;
end
-function resolver:cancel(qclass, qtype, qname, co, call_handler)
+function resolver:cancel(qclass, qtype, qname)
local cos = get(self.wanted, qclass, qtype, qname);
if cos then
- if call_handler then
- coroutine.resume(co);
+ for co in pairs(cos) do
+ if coroutine.status(co) == "suspended" then coroutine.resume(co); end
end
- cos[co] = nil;
+ set(self.wanted, qclass, qtype, qname, nil);
end
end