--- a/mod_srvinjection/mod_srvinjection.lua Wed Feb 26 13:08:47 2014 -0800
+++ b/mod_srvinjection/mod_srvinjection.lua Fri Feb 28 15:36:06 2014 +0100
@@ -1,3 +1,4 @@
+local s = require"util.serialization".new"oneline".serialize;
module:set_global();
@@ -25,8 +26,12 @@
local original_lookup = adns.lookup;
function adns.lookup(handler, qname, qtype, qclass)
+ module:log("debug", "adns.lookup(%s, %s, %s)", s(qname), s(qtype), s(qclass));
if qtype == "SRV" then
local host = qname:match("^_xmpp%-server%._tcp%.(.*)%.$");
+ module:log("debug", "qname:match(...) → %s", s(host));
+ local mapping = map[host] or map["*"];
+ module:log("debug", "map[%s] → %s", s(host), s(mapping));
local mapping = map[host] or map["*"];
if mapping then
handler(mapping);