diff options
-rw-r--r-- | net/dns.lua | 7 | ||||
-rw-r--r-- | plugins/mod_console.lua | 4 |
2 files changed, 7 insertions, 4 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 diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index c0f491de..e8d31ceb 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -515,7 +515,7 @@ function def_env.s2s:close(from, to) if not session then print("No outgoing connection from "..from.." to "..to) else - s2smanager.destroy_session(session); + (session.close or s2smanager.destroy_session)(session); count = count + 1; print("Closed outgoing session from "..from.." to "..to); end @@ -523,7 +523,7 @@ function def_env.s2s:close(from, to) -- Is an incoming connection for session in pairs(incoming_s2s) do if session.to_host == to and session.from_host == from then - s2smanager.destroy_session(session); + (session.close or s2smanager.destroy_session)(session); count = count + 1; end end |