mod_sasl2: Eventually return true from success handler
...while allowing other handlers to run in the priority range -1000 to -2000.
--- 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);