diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-09-24 23:47:16 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-09-24 23:47:16 +0100 |
commit | 23d676ee18f898b0db00358a1679bf8e56ef043b (patch) | |
tree | 9d561aa1d754e84bf2cfedffa1978bb5ebcc6bf9 | |
parent | c0f6d946e15e28b820fd7c0f301719c4c4425383 (diff) | |
parent | 9118f712274368d5794fb8b8a2831f678ae1c15b (diff) | |
download | prosody-23d676ee18f898b0db00358a1679bf8e56ef043b.tar.gz prosody-23d676ee18f898b0db00358a1679bf8e56ef043b.zip |
Merge with 0.5
-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 |