Changeset

12280:74f8739b967a

mod_s2s: Add new early s2s-connected events Allows doing things based on connections rather than sessions, which may have been created before or after.
author Kim Alvefur <zash@zash.se>
date Sun, 06 Feb 2022 14:31:27 +0100
parents 12279:f44eb0a6653a
children 12281:9016071867d7
files plugins/mod_s2s.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_s2s.lua	Sat Feb 05 18:07:51 2022 +0100
+++ b/plugins/mod_s2s.lua	Sun Feb 06 14:31:27 2022 +0100
@@ -820,11 +820,14 @@
 		session = s2s_new_incoming(conn);
 		sessions[conn] = session;
 		session.log("debug", "Incoming s2s connection");
+		module:fire_event("s2sin-connected", { session = session })
 		initialize_session(session);
 		m_accepted_tcp_connections:with_labels():add(1)
 	else -- Outgoing session connected
+		module:fire_event("s2sout-connected", { session = session })
 		session:open_stream(session.from_host, session.to_host);
 	end
+	module:fire_event("s2s-connected", { session = session })
 	session.ip = conn:ip();
 end