mod_sasl2: Eventually return true from success handler
authorMatthew Wild <mwild1@gmail.com>
Sun, 28 Aug 2022 11:25:21 +0100
changeset 5025 f62b091b1c81
parent 5024 6a36dae4a88d
child 5026 97d34d520cfa
mod_sasl2: Eventually return true from success handler ...while allowing other handlers to run in the priority range -1000 to -2000.
mod_sasl2/mod_sasl2.lua
--- a/mod_sasl2/mod_sasl2.lua	Sun Aug 28 11:18:10 2022 +0100
+++ b/mod_sasl2/mod_sasl2.lua	Sun Aug 28 11:25:21 2022 +0100
@@ -105,6 +105,14 @@
 	session.send(features);
 end, -1000);
 
+-- The gap here is to allow modules to do stuff to the stream after the stanza
+-- is sent, but before we proceed with anything else. This is expected to be
+-- a common pattern with SASL2, which allows atomic negotiation of a bunch of
+-- stream features.
+module:hook("sasl2/c2s/success", function (event) --luacheck: ignore 212/event
+	return true;
+end, -2000);
+
 local function process_cdata(session, cdata)
 	if cdata then
 		cdata = base64.decode(cdata);