diff options
author | Kim Alvefur <zash@zash.se> | 2021-04-10 16:45:44 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-04-10 16:45:44 +0200 |
commit | 7c5659808a440093dfce526f4f3d6bf1b2681b46 (patch) | |
tree | 9aa8eab484819c8e12daed4640bffb29c41980a5 | |
parent | 490980289f3c3c709bd08c7fa85ba13df3cd74dc (diff) | |
parent | f1550b900d4095dfde87ccc60bbfebb088b03ef5 (diff) | |
download | prosody-7c5659808a440093dfce526f4f3d6bf1b2681b46.tar.gz prosody-7c5659808a440093dfce526f4f3d6bf1b2681b46.zip |
Merge 0.11->trunk
-rw-r--r-- | plugins/mod_c2s.lua | 16 | ||||
-rw-r--r-- | plugins/mod_saslauth.lua | 3 |
2 files changed, 15 insertions, 4 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index 878b853d..fc838c0d 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -210,12 +210,12 @@ local function session_close(session, reason) 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 @@ module:hook_global("user-password-changed", function(event) 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 --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 5a049e67..97186325 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -45,6 +45,9 @@ local function build_reply(status, ret, err_msg) 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(); |