diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-12-05 19:24:01 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-12-05 19:24:01 +0000 |
commit | 0d2b952b610069996f733700117a2e62d5b73696 (patch) | |
tree | 85b082e3702efeb0e019107679816862619730cd /plugins | |
parent | 32371bbb23449dc86e5d66c54ae862747bc7f398 (diff) | |
download | prosody-0d2b952b610069996f733700117a2e62d5b73696.tar.gz prosody-0d2b952b610069996f733700117a2e62d5b73696.zip |
Add TLS socket to readlist before handshake starts, fixes major slow-down on TLS connections
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_console.lua | 2 | ||||
-rw-r--r-- | plugins/mod_saslauth.lua | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 4ac3c5fe..9b9fc217 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -33,7 +33,7 @@ function console:new_session(conn) local w = conn.write;
local session = { conn = conn;
send = function (t) w(tostring(t)); end;
- print = function (t) w("| "..tostring(t).."\n"); end;
+ print = function (t) w("| "..tostring(t).."\r\n"); end;
disconnect = function () conn.close(); end;
};
session.env = setmetatable({}, default_env_mt);
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 52ef68c7..d0ba8542 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -24,6 +24,8 @@ local sm_bind_resource = require "core.sessionmanager".bind_resource; local jid local base64 = require "util.encodings".base64; +local gettime = require "socket".gettime; + local usermanager_validate_credentials = require "core.usermanager".validate_credentials; local t_concat, t_insert = table.concat, table.insert; local tostring = tostring; @@ -64,14 +66,14 @@ local function handle_status(session, status) end end -local function password_callback(node, host, mechanism, raw_host) +local function password_callback(node, host, mechanism) local password = (datamanager.load(node, host, "accounts") or {}).password; -- FIXME handle hashed passwords local func = function(x) return x; end; if password then if mechanism == "PLAIN" then return func, password; elseif mechanism == "DIGEST-MD5" then - return func, md5(node..":"..raw_host..":"..password); + return func, md5(node..":"..host..":"..password); end end return func, nil; @@ -142,6 +144,8 @@ module:add_iq_handler("c2s", "urn:ietf:params:xml:ns:xmpp-bind", :tag("bind", { xmlns = xmlns_bind}) :tag("jid"):text(session.full_jid)); end + + session.log("******", "Connection took "..tostring(session.conntimetotal).." seconds"); end); module:add_iq_handler("c2s", "urn:ietf:params:xml:ns:xmpp-session", |