changeset 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 8ad2c526404c
children d2b82b90c413
files mod_s2s_log_certs/README.wiki mod_s2s_log_certs/mod_s2s_log_certs.lua
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_s2s_log_certs/README.wiki	Tue Aug 25 16:53:15 2015 +0200
+++ b/mod_s2s_log_certs/README.wiki	Tue Aug 25 16:58:39 2015 +0200
@@ -28,5 +28,6 @@
 = Compatibility =
 
 ||trunk||Works||
+||0.10||Works||
 ||0.9||Works||
 ||0.8||Doesn't work||
--- 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);