diff options
author | Jo?o Duarte <jvsDuarte08@gmail.com> | 2019-04-17 10:11:22 -0700 |
---|---|---|
committer | Jo?o Duarte <jvsDuarte08@gmail.com> | 2019-04-17 10:11:22 -0700 |
commit | cb8a085c3bcbec83ad6b65631f8189e406bca042 (patch) | |
tree | 5ff9d93a8fd6a2f671e62d45f85b65cf196808ba /plugins/mod_admin_telnet.lua | |
parent | 65ca6b82048f1b260291ea9d920d3b117a2603b4 (diff) | |
download | prosody-cb8a085c3bcbec83ad6b65631f8189e406bca042.tar.gz prosody-cb8a085c3bcbec83ad6b65631f8189e406bca042.zip |
mod_admin_telnet: Adds c2s:closeall() (Fixes #1315)
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 34cc4dc6..c66630ca 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -250,6 +250,7 @@ function commands.help(session, data) print [[c2s:show_secure() - Show all encrypted client connections]] print [[c2s:show_tls() - Show TLS cipher info for encrypted sessions]] print [[c2s:close(jid) - Close all sessions for the specified JID]] + print [[c2s:closeall() - Close all active c2s connections ]] elseif section == "s2s" then print [[s2s:show(domain) - Show all s2s connections for the given domain (or all if no domain given)]] print [[s2s:show_tls(domain) - Show TLS cipher info for encrypted sessions]] @@ -661,6 +662,16 @@ function def_env.c2s:close(match_jid) return true, "Total: "..count.." sessions closed"; end +function def_env.c2s:closeall() + local count = 0; + --luacheck: ignore 212/jid + show_c2s(function (jid, session) + count = count + 1; + session:close(); + end); + return true, "Total: "..count.." sessions closed"; +end + def_env.s2s = {}; function def_env.s2s:show(match_jid, annotate) |