diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-09 12:39:49 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-09 12:39:49 +0100 |
commit | 35cb12c554d8b5ee7134a0e15556e91a81a093b4 (patch) | |
tree | 03956a8a9247babc607ab26b998b387ff6caf3cd | |
parent | 25f5253ac069dccbc28d4495fc493b5667f3607b (diff) | |
parent | 329ee389c5fdea1e5cab9385accf7fd5fe80c7dc (diff) | |
download | prosody-35cb12c554d8b5ee7134a0e15556e91a81a093b4.tar.gz prosody-35cb12c554d8b5ee7134a0e15556e91a81a093b4.zip |
Merge 0.9->trunk
-rw-r--r-- | plugins/mod_admin_telnet.lua | 7 | ||||
-rw-r--r-- | plugins/mod_auth_anonymous.lua | 4 | ||||
-rw-r--r-- | plugins/mod_c2s.lua | 16 | ||||
-rw-r--r-- | plugins/mod_http.lua | 2 |
4 files changed, 25 insertions, 4 deletions
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 = {}; 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 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 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); |