aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-09-24 23:47:16 +0100
committerMatthew Wild <mwild1@gmail.com>2009-09-24 23:47:16 +0100
commit23d676ee18f898b0db00358a1679bf8e56ef043b (patch)
tree9d561aa1d754e84bf2cfedffa1978bb5ebcc6bf9 /net
parentc0f6d946e15e28b820fd7c0f301719c4c4425383 (diff)
parent9118f712274368d5794fb8b8a2831f678ae1c15b (diff)
downloadprosody-23d676ee18f898b0db00358a1679bf8e56ef043b.tar.gz
prosody-23d676ee18f898b0db00358a1679bf8e56ef043b.zip
Merge with 0.5
Diffstat (limited to 'net')
-rw-r--r--net/dns.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/dns.lua b/net/dns.lua
index da06ceaa..d6462031 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -95,7 +95,10 @@ local function prune (rrs, time, soft) -- - - - - - - - - - - - - - - prune
if rr.tod then
-- rr.tod = rr.tod - 50 -- accelerated decripitude
rr.ttl = math.floor (rr.tod - time)
- if rr.ttl <= 0 then rrs[i] = nil end
+ if rr.ttl <= 0 then
+ table.remove(rrs, i);
+ return prune(rrs, time, soft); -- Re-iterate
+ end
elseif soft == 'soft' then -- What is this? I forget!
assert (rr.ttl == 0)
@@ -507,7 +510,7 @@ function resolver:adddefaultnameservers () -- - - - - adddefaultnameservers
local resolv_conf = io.open("/etc/resolv.conf");
if resolv_conf then
for line in resolv_conf:lines() do
- local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)')
+ local address = string.match (line, '^%s*nameserver%s+(%d+%.%d+%.%d+%.%d+)%s*$')
if address then self:addnameserver (address) end
end
elseif os.getenv("WINDIR") then