# HG changeset patch # User Kim Alvefur # Date 1618065944 -7200 # Node ID 11186af62c8753581bca1cbe020d53c64f38e159 # Parent 9a3ebdd65f9c06cb2bb103777ca1589d39db42f9# Parent 549c80feede6135770b2967f12919bed993286da Merge 0.11->trunk diff -r 9a3ebdd65f9c -r 11186af62c87 plugins/mod_c2s.lua --- a/plugins/mod_c2s.lua Tue Apr 06 23:23:28 2021 +0200 +++ b/plugins/mod_c2s.lua Sat Apr 10 16:45:44 2021 +0200 @@ -210,12 +210,12 @@ if not session.destroyed then session.log("warn", "Failed to receive a stream close response, closing connection anyway..."); sm_destroy_session(session, reason_text); - conn:close(); + if conn then conn:close(); end end end); else sm_destroy_session(session, reason_text); - conn:close(); + if conn then conn:close(); end end else local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason; @@ -246,11 +246,19 @@ end, 200); function runner_callbacks:ready() - self.data.conn:resume(); + if self.data.conn then + self.data.conn:resume(); + else + (self.data.log or log)("debug", "Session has no connection to resume"); + end end function runner_callbacks:waiting() - self.data.conn:pause(); + if self.data.conn then + self.data.conn:pause(); + else + (self.data.log or log)("debug", "Session has no connection to pause while waiting"); + end end function runner_callbacks:error(err) diff -r 9a3ebdd65f9c -r 11186af62c87 plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Tue Apr 06 23:23:28 2021 +0200 +++ b/plugins/mod_saslauth.lua Sat Apr 10 16:45:44 2021 +0200 @@ -45,6 +45,9 @@ end local function handle_status(session, status, ret, err_msg) + if not session.sasl_handler then + return "failure", "temporary-auth-failure", "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();