Software /
code /
prosody
Diff
net/dns.lua @ 6289:a29cc79295e6
Merge 0.9->0.10
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 30 Jun 2014 13:11:01 +0200 |
parent | 5776:bd0ff8ae98a8 |
parent | 6288:d122420542fb |
child | 6312:1940a014aeca |
line wrap: on
line diff
--- a/net/dns.lua Sat Jun 21 15:05:21 2014 +0200 +++ b/net/dns.lua Mon Jun 30 13:11:01 2014 +0200 @@ -722,6 +722,14 @@ function resolver:query(qname, qtype, qclass) -- - - - - - - - - - -- query qname, qtype, qclass = standardize(qname, qtype, qclass) + local co = coroutine.running(); + local q = get(self.wanted, qclass, qtype, qname); + if co and q then + -- We are already waiting for a reply to an identical query. + set(self.wanted, qclass, qtype, qname, co, true); + return true; + end + if not self.server then self:adddefaultnameservers(); end local question = encodeQuestion(qname, qtype, qclass); @@ -742,7 +750,6 @@ self.active[id][question] = o; -- remember which coroutine wants the answer - local co = coroutine.running(); if co then set(self.wanted, qclass, qtype, qname, co, true); --set(self.yielded, co, qclass, qtype, qname, true);