# HG changeset patch # User Kim Alvefur # Date 1404126661 -7200 # Node ID a29cc79295e66ab3036020b238b484e3c1887cae # Parent b49540983320563addfb579ff2f65041d8523a2f# Parent d122420542fbaafcbe40bce1dc19b7230e14b2ec Merge 0.9->0.10 diff -r b49540983320 -r a29cc79295e6 net/adns.lua --- a/net/adns.lua Sat Jun 21 15:05:21 2014 +0200 +++ b/net/adns.lua Mon Jun 30 13:11:01 2014 +0200 @@ -52,6 +52,7 @@ local peername = ""; local listener = {}; local handler = {}; + local err; function listener.onincoming(conn, data) if data then dns.feed(handler, data); diff -r b49540983320 -r a29cc79295e6 net/dns.lua --- 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);