comparison mod_s2s_log_certs/mod_s2s_log_certs.lua @ 1787:663e5d923ef0

mod_s2s_log_certs: Use new 0.10 API for wrapping event handlers in order to always print log message after all s2s cert checks
author Kim Alvefur <zash@zash.se>
date Tue, 25 Aug 2015 16:58:39 +0200
parents 79ef0427765f
children
comparison
equal deleted inserted replaced
1786:8ad2c526404c 1787:663e5d923ef0
36 identity_status = identity_status; 36 identity_status = identity_status;
37 dm_store(remote_host, local_host, "s2s_certs", seen_certs); 37 dm_store(remote_host, local_host, "s2s_certs", seen_certs);
38 end 38 end
39 end 39 end
40 40
41 module:hook("s2s-check-certificate", note_cert_digest, 1000); 41 if module.wrap_event then
42 -- 0.10
43 module:wrap_event("s2s-check-certificate", function (handlers, event_name, event_data)
44 local ret = handlers(event_name, event_data);
45 note_cert_digest(event_data);
46 return ret;
47 end);
48 else
49 -- 0.9
50 module:hook("s2s-check-certificate", note_cert_digest, 1000);
51 end
42 --[[ 52 --[[
43 function module.add_host(module) 53 function module.add_host(module)
44 module:hook("s2s-check-certificate", note_cert_digest, 1000); 54 module:hook("s2s-check-certificate", note_cert_digest, 1000);
45 end 55 end
46 ]] 56 ]]