diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-07-05 12:05:46 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-07-05 12:05:46 +0100 |
commit | cad77ed8cfa2bdb6f93ea65c90a17c624bdc7e6e (patch) | |
tree | ce887a9f5552da1a84ab5efa2624848a80731ef7 /net/dns.lua | |
parent | e23e53d3b8d5af13e22fbbb41768e72790d91c3d (diff) | |
download | prosody-cad77ed8cfa2bdb6f93ea65c90a17c624bdc7e6e.tar.gz prosody-cad77ed8cfa2bdb6f93ea65c90a17c624bdc7e6e.zip |
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
Diffstat (limited to 'net/dns.lua')
-rw-r--r-- | net/dns.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dns.lua b/net/dns.lua index 6a74abd8..b3cce111 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -698,7 +698,7 @@ function resolver:query(qname, qtype, qclass) -- - - - - - - - - - -- query 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 @@ function resolver:feed(sock, packet) 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 |