From 440837480dbdbfb36123659cf5e2b4e2a0e63a2f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Dec 2012 11:44:45 +0100 Subject: mod_admin_telnet: Improve wording when listing users --- plugins/mod_admin_telnet.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 0af571eb..a56f2992 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -960,14 +960,15 @@ function def_env.user:list(host, pat) return nil, "No such host"; end local print = self.session.print; - local count = 0; + local total, matches = 0, 0; for user in um.users(host) do if not pat or user:match(pat) then print(user.."@"..host); + matches = matches + 1; end - count = count + 1; + total = total + 1; end - return true, count .. " users total"; + return true, "Showing "..(pat and (matches.." of ") or "all " )..total.." users"; end def_env.xmpp = {}; -- cgit v1.2.3 From 233b38c3b0175eddbefb12ca5f485fea3189fe2a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Dec 2012 11:50:09 +0100 Subject: mod_c2s: Check if TLS compression is used --- plugins/mod_c2s.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index dabed021..72085113 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -66,6 +66,14 @@ function stream_callbacks.streamopened(session, attr) -- since we now have a new stream header, session is secured if session.secure == false then session.secure = true; + + -- Check if TLS compression is used + local sock = session.conn:socket(); + if sock.info then + session.compressed = sock:info"compression"; + elseif sock.compression then + session.compressed = sock:compression(); --COMPAT mw/luasec-hg + end end local features = st.stanza("stream:features"); @@ -189,6 +197,14 @@ function listener.onconnect(conn) -- Client is using legacy SSL (otherwise mod_tls sets this flag) if conn:ssl() then session.secure = true; + + -- Check if TLS compression is used + local sock = conn:socket(); + if sock.info then + session.compressed = sock:info"compression"; + elseif sock.compression then + session.compressed = sock:compression(); --COMPAT mw/luasec-hg + end end if opt_keepalives then -- cgit v1.2.3 From fbbd1b1c674b650f3b82997de85a3707d12d7d1d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Dec 2012 12:19:08 +0100 Subject: mod_auth_anonymous: Implement user iteration API --- plugins/mod_auth_anonymous.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_auth_anonymous.lua b/plugins/mod_auth_anonymous.lua index c27057be..a327f438 100644 --- a/plugins/mod_auth_anonymous.lua +++ b/plugins/mod_auth_anonymous.lua @@ -41,6 +41,10 @@ function provider.get_sasl_handler() return new_sasl(module.host, anonymous_authentication_profile); end +function provider.users() + return next, hosts[host].sessions, nil; +end + -- datamanager callback to disable writes local function dm_callback(username, host, datastore, data) if host == module.host then -- cgit v1.2.3 From 329ee389c5fdea1e5cab9385accf7fd5fe80c7dc Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Dec 2012 12:20:55 +0100 Subject: mod_http: Fix path length pattern --- plugins/mod_http.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index e73778ae..018f2ea3 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -88,7 +88,7 @@ function module.add_host(module) local data = handler; handler = function () return data; end elseif event_name:sub(-2, -1) == "/*" then - local base_path_len = #event_name:match("(/.+/)%*$")+1; + local base_path_len = #event_name:match("/.+$"); local _handler = handler; handler = function (event) local path = event.request.path:sub(base_path_len); -- cgit v1.2.3