Mercurial > prosody-hg
comparison plugins/mod_admin_telnet.lua @ 9974:c30933aa0242
mod_admin_telnet: Adds c2s:closeall() (Fixes #1315)
| author | João Duarte <jvsDuarte08@gmail.com> |
|---|---|
| date | Wed, 17 Apr 2019 10:11:22 -0700 |
| parents | 0361e3379dd1 |
| children | 521fb218098d |
comparison
equal
deleted
inserted
replaced
| 9970:4a43feb9ab15 | 9974:c30933aa0242 |
|---|---|
| 248 print [[c2s:show(jid) - Show all client sessions with the specified JID (or all if no JID given)]] | 248 print [[c2s:show(jid) - Show all client sessions with the specified JID (or all if no JID given)]] |
| 249 print [[c2s:show_insecure() - Show all unencrypted client connections]] | 249 print [[c2s:show_insecure() - Show all unencrypted client connections]] |
| 250 print [[c2s:show_secure() - Show all encrypted client connections]] | 250 print [[c2s:show_secure() - Show all encrypted client connections]] |
| 251 print [[c2s:show_tls() - Show TLS cipher info for encrypted sessions]] | 251 print [[c2s:show_tls() - Show TLS cipher info for encrypted sessions]] |
| 252 print [[c2s:close(jid) - Close all sessions for the specified JID]] | 252 print [[c2s:close(jid) - Close all sessions for the specified JID]] |
| 253 print [[c2s:closeall() - Close all active c2s connections ]] | |
| 253 elseif section == "s2s" then | 254 elseif section == "s2s" then |
| 254 print [[s2s:show(domain) - Show all s2s connections for the given domain (or all if no domain given)]] | 255 print [[s2s:show(domain) - Show all s2s connections for the given domain (or all if no domain given)]] |
| 255 print [[s2s:show_tls(domain) - Show TLS cipher info for encrypted sessions]] | 256 print [[s2s:show_tls(domain) - Show TLS cipher info for encrypted sessions]] |
| 256 print [[s2s:close(from, to) - Close a connection from one domain to another]] | 257 print [[s2s:close(from, to) - Close a connection from one domain to another]] |
| 257 print [[s2s:closeall(host) - Close all the incoming/outgoing s2s sessions to specified host]] | 258 print [[s2s:closeall(host) - Close all the incoming/outgoing s2s sessions to specified host]] |
| 659 end | 660 end |
| 660 end); | 661 end); |
| 661 return true, "Total: "..count.." sessions closed"; | 662 return true, "Total: "..count.." sessions closed"; |
| 662 end | 663 end |
| 663 | 664 |
| 665 function def_env.c2s:closeall() | |
| 666 local count = 0; | |
| 667 --luacheck: ignore 212/jid | |
| 668 show_c2s(function (jid, session) | |
| 669 count = count + 1; | |
| 670 session:close(); | |
| 671 end); | |
| 672 return true, "Total: "..count.." sessions closed"; | |
| 673 end | |
| 674 | |
| 664 | 675 |
| 665 def_env.s2s = {}; | 676 def_env.s2s = {}; |
| 666 function def_env.s2s:show(match_jid, annotate) | 677 function def_env.s2s:show(match_jid, annotate) |
| 667 local print = self.session.print; | 678 local print = self.session.print; |
| 668 annotate = annotate or session_flags; | 679 annotate = annotate or session_flags; |
