Software /
code /
prosody
Diff
net/dns.lua @ 3326:fb95015bc646
net.dns, net.adns: Update resolver:cancel() API so that a table doesn't need to be created for each cancellation internal to net.dns
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 05 Jul 2010 12:05:46 +0100 |
parent | 3325:b3117a1da834 |
child | 3327:b447682f2a8d |
line wrap: on
line diff
--- a/net/dns.lua Mon Jul 05 11:51:17 2010 +0100 +++ b/net/dns.lua Mon Jul 05 12:05:46 2010 +0100 @@ -698,7 +698,7 @@ return dns_timeout; else -- Tried everything, failed - resolver:cancel({qclass, qtype, qname, co}, true); + resolver:cancel(qclass, qtype, qname, co, true); end end end) @@ -830,13 +830,13 @@ return response; end -function resolver:cancel(data, call_handler) - local cos = get(self.wanted, unpack(data, 1, 3)); +function resolver:cancel(qclass, qtype, qname, co, call_handler) + local cos = get(self.wanted, qclass, qtype, qname); if cos then if call_handler then - coroutine.resume(data[4]); + coroutine.resume(co); end - cos[data[4]] = nil; + cos[co] = nil; end end