Software /
code /
prosody
Diff
net/dns.lua @ 1823:7c3ec7ac6316
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 24 Sep 2009 23:47:16 +0100 |
parent | 1816:1c0bde3db7d8 |
parent | 1822:2f78ea5d0f11 |
child | 1836:f4c88dd32724 |
line wrap: on
line diff
--- a/net/dns.lua Fri Sep 25 03:23:31 2009 +0500 +++ b/net/dns.lua Thu Sep 24 23:47:16 2009 +0100 @@ -95,7 +95,10 @@ 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 @@ 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