aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
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