Software / code / prosody
Comparison
net/dns.lua @ 7093:388281be2bc7
net.dns: Remember query only after it was sent, in case it was not (fixes #598)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 21 Jan 2016 22:26:46 +0100 |
| parent | 7059:7ec52755622f |
| child | 7098:5286e79c6829 |
| child | 8151:2c65f8be38aa |
comparison
equal
deleted
inserted
replaced
| 7092:bee63de49663 | 7093:388281be2bc7 |
|---|---|
| 761 | 761 |
| 762 -- remember the query | 762 -- remember the query |
| 763 self.active[id] = self.active[id] or {}; | 763 self.active[id] = self.active[id] or {}; |
| 764 self.active[id][question] = o; | 764 self.active[id][question] = o; |
| 765 | 765 |
| 766 local conn, err = self:getsocket(o.server) | |
| 767 if not conn then | |
| 768 return nil, err; | |
| 769 end | |
| 770 conn:send (o.packet) | |
| 771 | |
| 766 -- remember which coroutine wants the answer | 772 -- remember which coroutine wants the answer |
| 767 if co then | 773 if co then |
| 768 set(self.wanted, qclass, qtype, qname, co, true); | 774 set(self.wanted, qclass, qtype, qname, co, true); |
| 769 end | 775 end |
| 770 | |
| 771 local conn, err = self:getsocket(o.server) | |
| 772 if not conn then | |
| 773 return nil, err; | |
| 774 end | |
| 775 conn:send (o.packet) | |
| 776 | 776 |
| 777 if timer and self.timeout then | 777 if timer and self.timeout then |
| 778 local num_servers = #self.server; | 778 local num_servers = #self.server; |
| 779 local i = 1; | 779 local i = 1; |
| 780 timer.add_task(self.timeout, function () | 780 timer.add_task(self.timeout, function () |