aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-03-09 18:46:19 +0000
committerMatthew Wild <mwild1@gmail.com>2012-03-09 18:46:19 +0000
commit57b4839a319c57177c831eeb1ca57eb51e1eb971 (patch)
tree7c222d85dc580e33e11963d66a26a2c6bb1c7b1e
parent4ba5589a50b2cefee335af2f12eff770079ef5d7 (diff)
parent9b41a236b0162a863c8417119795481814eb3c01 (diff)
downloadprosody-57b4839a319c57177c831eeb1ca57eb51e1eb971.tar.gz
prosody-57b4839a319c57177c831eeb1ca57eb51e1eb971.zip
Merge 0.9->trunk
-rw-r--r--core/s2smanager.lua2
-rw-r--r--plugins/mod_admin_telnet.lua22
2 files changed, 21 insertions, 3 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index a27b2b2d..acb0baeb 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -549,7 +549,7 @@ function streamopened(session, attr)
session.from_host = attr.from and nameprep(attr.from);
session.streamid = uuid_gen();
- (session.log or log)("debug", "Incoming s2s received <stream:stream>");
+ (session.log or log)("debug", "Incoming s2s received %s", st.stanza("stream:stream", attr):top_tag());
if session.to_host then
if not hosts[session.to_host] then
-- Attempting to connect to a host we don't serve
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index b211d271..0dfdc827 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -487,6 +487,24 @@ function def_env.c2s:close(match_jid)
return true, "Total: "..count.." sessions closed";
end
+local function session_flags(session, line)
+ if session.cert_identity_status == "valid" then
+ line[#line+1] = "(secure)";
+ elseif session.secure then
+ line[#line+1] = "(encrypted)";
+ end
+ if session.compressed then
+ line[#line+1] = "(compressed)";
+ end
+ if session.smacks then
+ line[#line+1] = "(sm)";
+ end
+ if session.conn and session.conn:ip():match(":") then
+ line[#line+1] = "(IPv6)";
+ end
+ return table.concat(line, " ");
+end
+
def_env.s2s = {};
function def_env.s2s:show(match_jid)
local _print = self.session.print;
@@ -499,7 +517,7 @@ function def_env.s2s:show(match_jid)
for remotehost, session in pairs(host_session.s2sout) do
if (not match_jid) or remotehost:match(match_jid) or host:match(match_jid) then
count_out = count_out + 1;
- print(" "..host.." -> "..remotehost..(session.cert_identity_status == "valid" and " (secure)" or "")..(session.secure and " (encrypted)" or "")..(session.compressed and " (compressed)" or ""));
+ print(session_flags(session, {" ", host, "->", remotehost}));
if session.sendq then
print(" There are "..#session.sendq.." queued outgoing stanzas for this connection");
end
@@ -536,7 +554,7 @@ function def_env.s2s:show(match_jid)
-- Pft! is what I say to list comprehensions
or (session.hosts and #array.collect(keys(session.hosts)):filter(subhost_filter)>0)) then
count_in = count_in + 1;
- print(" "..host.." <- "..(session.from_host or "(unknown)")..(session.cert_identity_status == "valid" and " (secure)" or "")..(session.secure and " (encrypted)" or "")..(session.compressed and " (compressed)" or ""));
+ print(session_flags(session, {" ", host, "<-", session.from_host or "(unknown)"}));
if session.type == "s2sin_unauthed" then
print(" Connection not yet authenticated");
end