Mercurial > prosody-modules
comparison mod_watchuntrusted/mod_watchuntrusted.lua @ 1693:2328cbc41045
mod_watchuntrusted: Skip connections to/from unknown hosts (fixes possible traceback)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 05 May 2015 12:09:08 +0200 |
parents | 116488cced16 |
children | 055b39c08fd0 |
comparison
equal
deleted
inserted
replaced
1692:44ddec97ad82 | 1693:2328cbc41045 |
---|---|
11 | 11 |
12 local notified_about_already = { }; | 12 local notified_about_already = { }; |
13 | 13 |
14 module:hook_global("s2s-check-certificate", function (event) | 14 module:hook_global("s2s-check-certificate", function (event) |
15 local session, host = event.session, event.host; | 15 local session, host = event.session, event.host; |
16 if not host then return end | |
16 local conn = session.conn:socket(); | 17 local conn = session.conn:socket(); |
17 local local_host = session.direction == "outgoing" and session.from_host or session.to_host; | 18 local local_host = session.direction == "outgoing" and session.from_host or session.to_host; |
18 | 19 |
19 if not (local_host == module:get_host()) then return end | 20 if not (local_host == module:get_host()) then return end |
20 | 21 |