mod_saslauth: Don't throw errors in async code when connections are gone 0.11
authortmolitor <thilo@eightysoft.de>
Thu, 18 Mar 2021 14:30:47 +0100
branch0.11
changeset 11512 f1abc34414bc
parent 11511 133e8ed291fe
child 11513 dfdec3f9ccb1
mod_saslauth: Don't throw errors in async code when connections are gone Fixes #1515
plugins/mod_saslauth.lua
--- a/plugins/mod_saslauth.lua	Thu Mar 18 14:30:32 2021 +0100
+++ b/plugins/mod_saslauth.lua	Thu Mar 18 14:30:47 2021 +0100
@@ -44,6 +44,7 @@
 end
 
 local function handle_status(session, status, ret, err_msg)
+	if session["sasl_handler"] == nil then return "failure", "connection-timeout", "Connection gone"; end
 	if status == "failure" then
 		module:fire_event("authentication-failure", { session = session, condition = ret, text = err_msg });
 		session.sasl_handler = session.sasl_handler:clean_clone();