Mercurial > prosody-modules
comparison mod_s2s_auth_dnssec_srv/mod_s2s_auth_dnssec_srv.lua @ 1363:478b3288192f
mod_s2s_auth_dnssec_srv: Fix tb when no hostname sent by remote
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 19 Mar 2014 19:51:57 +0100 |
parents | b9213ddb860f |
children |
comparison
equal
deleted
inserted
replaced
1362:920ac9a8480b | 1363:478b3288192f |
---|---|
38 end); | 38 end); |
39 | 39 |
40 function module.add_host(module) | 40 function module.add_host(module) |
41 module:hook("s2s-stream-features", function(event) | 41 module:hook("s2s-stream-features", function(event) |
42 local host_session = event.origin; | 42 local host_session = event.origin; |
43 local name = to_ascii(host_session.from_host); | 43 local name = host_session.from_host and to_ascii(host_session.from_host); |
44 if not name then return end | 44 if not name then return end |
45 dns_lookup(function (answer) | 45 dns_lookup(function (answer) |
46 if host_session.dane ~= nil then return end | 46 if host_session.dane ~= nil then return end |
47 if not answer.secure or #answer == 1 | 47 if not answer.secure or #answer == 1 |
48 and answer[1].srv.target == "." then return end | 48 and answer[1].srv.target == "." then return end |