aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-04-10 16:45:44 +0200
committerKim Alvefur <zash@zash.se>2021-04-10 16:45:44 +0200
commit7c5659808a440093dfce526f4f3d6bf1b2681b46 (patch)
tree9aa8eab484819c8e12daed4640bffb29c41980a5 /plugins/mod_c2s.lua
parent490980289f3c3c709bd08c7fa85ba13df3cd74dc (diff)
parentf1550b900d4095dfde87ccc60bbfebb088b03ef5 (diff)
downloadprosody-7c5659808a440093dfce526f4f3d6bf1b2681b46.tar.gz
prosody-7c5659808a440093dfce526f4f3d6bf1b2681b46.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua16
1 files changed, 12 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)