aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-06 15:31:21 +0100
committerKim Alvefur <zash@zash.se>2017-03-06 15:31:21 +0100
commit12b74e9dde7fbabe26e3bcca7d0249621344476a (patch)
tree12c170f5c451cd6de06f1b842d220909e39f46e9 /plugins/mod_c2s.lua
parent0e71fac1d18b0de0e9203cb6b71c971d55c8c70c (diff)
parenta889b0287767bd9e7ab5f213607f453acac448f9 (diff)
downloadprosody-12b74e9dde7fbabe26e3bcca7d0249621344476a.tar.gz
prosody-12b74e9dde7fbabe26e3bcca7d0249621344476a.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index d106ed37..c1b5ee98 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -168,27 +168,27 @@ local function session_close(session, reason)
session.send("</stream:stream>");
function session.send() return false; end
- local reason = (reason and (reason.name or reason.text or reason.condition)) or reason;
- session.log("debug", "c2s stream for %s closed: %s", session.full_jid or ("<"..session.ip..">"), reason or "session closed");
+ local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason;
+ session.log("debug", "c2s stream for %s closed: %s", session.full_jid or ("<"..session.ip..">"), reason_text or "session closed");
-- Authenticated incoming stream may still be sending us stanzas, so wait for </stream:stream> from remote
local conn = session.conn;
- if reason == nil and not session.notopen and session.type == "c2s" then
+ if reason_text == nil and not session.notopen and session.type == "c2s" then
-- Grace time to process data from authenticated cleanly-closed stream
add_task(stream_close_timeout, function ()
if not session.destroyed then
session.log("warn", "Failed to receive a stream close response, closing connection anyway...");
- sm_destroy_session(session, reason);
+ sm_destroy_session(session, reason_text);
conn:close();
end
end);
else
- sm_destroy_session(session, reason);
+ sm_destroy_session(session, reason_text);
conn:close();
end
else
- local reason = (reason and (reason.name or reason.text or reason.condition)) or reason;
- sm_destroy_session(session, reason);
+ local reason_text = (reason and (reason.name or reason.text or reason.condition)) or reason;
+ sm_destroy_session(session, reason_text);
end
end
@@ -196,7 +196,7 @@ module:hook_global("user-deleted", function(event)
local username, host = event.username, event.host;
local user = hosts[host].sessions[username];
if user and user.sessions then
- for jid, session in pairs(user.sessions) do
+ for _, session in pairs(user.sessions) do
session:close{ condition = "not-authorized", text = "Account deleted" };
end
end