net.dns, net.adns: Move coroutine-calling logic into resolver:cancel()
[prosody.git] / net / adns.lua
index 88d4b4b39c4c1e2b71e0b9c36424f2b998ad1700..7fadbe3f7e68d2a75c8f40e7a9aede67457a958f 100644 (file)
@@ -36,12 +36,9 @@ function lookup(handler, qname, qtype, qclass)
                        end)(dns.peek(qname, qtype, qclass));
 end
 
-function cancel(handle, call_handler)
+function cancel(handle, call_handler, reason)
        log("warn", "Cancelling DNS lookup for %s", tostring(handle[3]));
-       dns.cancel(handle);
-       if call_handler then
-               coroutine.resume(handle[4]);
-       end
+       dns.cancel(handle, call_handler);
 end
 
 function new_async_socket(sock, resolver)