aboutsummaryrefslogtreecommitdiffstats
path: root/net/dns.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-01-21 14:02:56 +0000
committerMatthew Wild <mwild1@gmail.com>2011-01-21 14:02:56 +0000
commit3dda2fcfac6774f42c10338bfc2362ad666b9c5b (patch)
tree23a32d78c0d79b7870e1a87f0e6350716c7ba6e0 /net/dns.lua
parentc6d7c5abfd104bdccf535c312ba7c4eb12679de4 (diff)
parent75862530f265ec9fdc58f7937d90367d252ce74a (diff)
downloadprosody-3dda2fcfac6774f42c10338bfc2362ad666b9c5b.tar.gz
prosody-3dda2fcfac6774f42c10338bfc2362ad666b9c5b.zip
Merge 0.8->trunk
Diffstat (limited to 'net/dns.lua')
-rw-r--r--net/dns.lua17
1 files changed, 7 insertions, 10 deletions
diff --git a/net/dns.lua b/net/dns.lua
index 61fb62e8..c905f56c 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -158,8 +158,6 @@ resolver.__index = resolver;
resolver.timeout = default_timeout;
-local SRV_tostring;
-
local function default_rr_tostring(rr)
local rr_val = rr.type and rr[rr.type:lower()];
if type(rr_val) ~= "string" then
@@ -170,8 +168,13 @@ end
local special_tostrings = {
LOC = resolver.LOC_tostring;
- MX = function (rr) return string.format('%2i %s', rr.pref, rr.mx); end;
- SRV = SRV_tostring;
+ MX = function (rr)
+ return string.format('%2i %s', rr.pref, rr.mx);
+ end;
+ SRV = function (rr)
+ local s = rr.srv;
+ return string.format('%5d %5d %5d %s', s.priority, s.weight, s.port, s.target);
+ end;
};
local rr_metatable = {}; -- - - - - - - - - - - - - - - - - - - rr_metatable
@@ -475,12 +478,6 @@ function resolver:PTR(rr)
rr.ptr = self:name();
end
-function SRV_tostring(rr) -- - - - - - - - - - - - - - - - - - SRV_tostring
- local s = rr.srv;
- return string.format( '%5d %5d %5d %s', s.priority, s.weight, s.port, s.target );
-end
-
-
function resolver:TXT(rr) -- - - - - - - - - - - - - - - - - - - - - - TXT
rr.txt = self:sub (rr.rdlength);
end