Software /
code /
prosody
Changeset
1823:7c3ec7ac6316
Merge with 0.5
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 24 Sep 2009 23:47:16 +0100 |
parents | 1819:ed1911be26c7 (current diff) 1822:2f78ea5d0f11 (diff) |
children | 1824:8e66c9d09f81 1836:f4c88dd32724 |
files | net/dns.lua plugins/mod_console.lua |
diffstat | 2 files changed, 7 insertions(+), 4 deletions(-) [+] |
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
--- a/plugins/mod_console.lua Fri Sep 25 03:23:31 2009 +0500 +++ b/plugins/mod_console.lua Thu Sep 24 23:47:16 2009 +0100 @@ -515,7 +515,7 @@ 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 @@ -- 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