aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-22 14:49:05 +0100
committerKim Alvefur <zash@zash.se>2016-01-22 14:49:05 +0100
commit6116ba8cfbeff29bd3c4cedd1b05babec47e1507 (patch)
tree3f7098f07d3ae232ef8a765d0bedcc4d1cda8df2 /net/dns.lua
parentf9bec76a46fe06d38d82f11489a191574302bc21 (diff)
parent2ed7876beae4800d8ba88a61607612350bfeca73 (diff)
downloadprosody-6116ba8cfbeff29bd3c4cedd1b05babec47e1507.tar.gz
prosody-6116ba8cfbeff29bd3c4cedd1b05babec47e1507.zip
Merge 0.9->0.10
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/dns.lua b/net/dns.lua
index d711af34..b047ec54 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -754,17 +754,17 @@ function resolver:query(qname, qtype, qclass) -- - - - - - - - - - -- query
self.active[id] = self.active[id] or {};
self.active[id][question] = o;
- -- remember which coroutine wants the answer
- if co then
- set(self.wanted, qclass, qtype, qname, co, true);
- end
-
local conn, err = self:getsocket(o.server)
if not conn then
return nil, err;
end
conn:send (o.packet)
+ -- remember which coroutine wants the answer
+ if co then
+ set(self.wanted, qclass, qtype, qname, co, true);
+ end
+
if timer and self.timeout then
local num_servers = #self.server;
local i = 1;
@@ -861,7 +861,7 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive
-- retire the query
local queries = self.active[response.header.id];
queries[response.question.raw] = nil;
-
+
if not next(queries) then self.active[response.header.id] = nil; end
if not next(self.active) then self:closeall(); end
@@ -875,7 +875,7 @@ function resolver:receive(rset) -- - - - - - - - - - - - - - - - - receive
set(self.wanted, q.class, q.type, q.name, nil);
end
end
-
+
end
end
end