aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-02 23:03:02 +0100
committerKim Alvefur <zash@zash.se>2017-03-02 23:03:02 +0100
commit8407f360939fe103a991641b0bf3b85e87d660b9 (patch)
tree4b71bdc7622635a101579c04b2d9e0c56991df2c /plugins
parenta11a584a59cde70ce4f0880049b9e675d8b2e223 (diff)
parentfdf81e53aa57c68f330deecf4f97cfefb05f5044 (diff)
downloadprosody-8407f360939fe103a991641b0bf3b85e87d660b9.tar.gz
prosody-8407f360939fe103a991641b0bf3b85e87d660b9.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_saslauth.lua15
-rw-r--r--plugins/mod_websocket.lua8
2 files changed, 19 insertions, 4 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 68c4fe64..ee468c17 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -96,8 +96,19 @@ end)
module:hook_stanza(xmlns_sasl, "failure", function (session, stanza)
if session.type ~= "s2sout_unauthed" or session.external_auth ~= "attempting" then return; end
- module:log("info", "SASL EXTERNAL with %s failed", session.to_host)
- -- TODO: Log the failure reason
+ local text = stanza:get_child_text("text");
+ local condition = "unknown-condition";
+ for child in stanza:childtags() do
+ if child.name ~= "text" then
+ condition = child.name;
+ break;
+ end
+ end
+ if text and condition then
+ condition = connection .. ": " .. text;
+ end
+ module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition);
+
session.external_auth = "failed"
session:close();
return true;
diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua
index 47d170a1..3c96f780 100644
--- a/plugins/mod_websocket.lua
+++ b/plugins/mod_websocket.lua
@@ -51,13 +51,17 @@ local sessions = module:shared("c2s/sessions");
local c2s_listener = portmanager.get_service("c2s").listener;
--- Session methods
-local function session_open_stream(session)
+local function session_open_stream(session, from, to)
local attr = {
xmlns = xmlns_framing,
+ ["xml:lang"] = "en",
version = "1.0",
id = session.streamid or "",
- from = session.host
+ from = from or session.host, to = to,
};
+ if session.stream_attrs then
+ session:stream_attrs(from, to, attr)
+ end
session.send(st.stanza("open", attr));
end