# HG changeset patch # User Matthew Wild # Date 1406286487 -3600 # Node ID b6f76a52eb361ee5209257f4814ca16fd4c57ac3 # Parent 5b298a6ecf0c0fd2721f05279cea59edac982f03 net.dns: Ensure all pending requests get notified of a timeout when looking up a record (fix for d122420542fb) diff -r 5b298a6ecf0c -r b6f76a52eb36 net/dns.lua --- a/net/dns.lua Thu Jul 03 17:53:24 2014 +0200 +++ b/net/dns.lua Fri Jul 25 12:08:07 2014 +0100 @@ -770,7 +770,7 @@ end end -- Tried everything, failed - self:cancel(qclass, qtype, qname, co, true); + self:cancel(qclass, qtype, qname); end end) end @@ -910,13 +910,13 @@ 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