net/dns.lua
changeset 6309 b6f76a52eb36
parent 6288 d122420542fb
child 6310 d232bb1bbe1e
--- 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