Mercurial > prosody-modules
comparison mod_s2s_auth_dane/mod_s2s_auth_dane.lua @ 1391:b183e78aee91
mod_s2s_auth_dane: Skip dns queries for already authenticated s2sin connections
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 24 Apr 2014 18:33:13 +0200 |
parents | 1fcd280c226b |
children | d99c10fc4d19 |
comparison
equal
deleted
inserted
replaced
1390:1fcd280c226b | 1391:b183e78aee91 |
---|---|
109 | 109 |
110 function module.add_host(module) | 110 function module.add_host(module) |
111 module:hook("s2s-stream-features", function(event) | 111 module:hook("s2s-stream-features", function(event) |
112 -- dane_lookup(origin, origin.from_host); | 112 -- dane_lookup(origin, origin.from_host); |
113 local host_session = event.origin; | 113 local host_session = event.origin; |
114 if host_session.type == "s2sin" then return end -- Already authenticated | |
114 host_session.log("debug", "Pausing connection until DANE lookup is completed"); | 115 host_session.log("debug", "Pausing connection until DANE lookup is completed"); |
115 host_session.conn:pause() | 116 host_session.conn:pause() |
116 local function resume() | 117 local function resume() |
117 host_session.log("debug", "DANE lookup completed, resuming connection"); | 118 host_session.log("debug", "DANE lookup completed, resuming connection"); |
118 host_session.conn:resume() | 119 host_session.conn:resume() |