aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-21 22:26:46 +0100
committerKim Alvefur <zash@zash.se>2016-01-21 22:26:46 +0100
commitecf5de4a4deb14356c5ceb45e963d2c7e0763b58 (patch)
treee490953514b654df57dd1a085fc6a2c22d786bac /net/dns.lua
parentffb24222c3a2a8371273b73dbc0654e9a9300c2b (diff)
downloadprosody-ecf5de4a4deb14356c5ceb45e963d2c7e0763b58.tar.gz
prosody-ecf5de4a4deb14356c5ceb45e963d2c7e0763b58.zip
net.dns: Remember query only after it was sent, in case it was not (fixes #598)
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dns.lua b/net/dns.lua
index f56157d0..d123731c 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -763,16 +763,16 @@ 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;