Diff

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
parent 1091:79ef0427765f
line wrap: on
line diff
--- a/mod_s2s_log_certs/mod_s2s_log_certs.lua	Tue Aug 25 16:53:15 2015 +0200
+++ b/mod_s2s_log_certs/mod_s2s_log_certs.lua	Tue Aug 25 16:58:39 2015 +0200
@@ -38,7 +38,17 @@
 	end
 end
 
-module:hook("s2s-check-certificate", note_cert_digest, 1000);
+if module.wrap_event then
+	-- 0.10
+	module:wrap_event("s2s-check-certificate", function (handlers, event_name, event_data)
+		local ret = handlers(event_name, event_data);
+		note_cert_digest(event_data);
+		return ret;
+	end);
+else
+	-- 0.9
+	module:hook("s2s-check-certificate", note_cert_digest, 1000);
+end
 --[[
 function module.add_host(module)
 	module:hook("s2s-check-certificate", note_cert_digest, 1000);