aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-01-23 02:15:28 +0000
committerMatthew Wild <mwild1@gmail.com>2012-01-23 02:15:28 +0000
commit5c1ba3bb130a78863510e6f62f9be51f83e94a95 (patch)
treeeb49e3c067ac3da0d293321f16afdc64492762d3
parent7a2a2a4cd7a54945df1a849af7f37a9a91783d53 (diff)
downloadprosody-5c1ba3bb130a78863510e6f62f9be51f83e94a95.tar.gz
prosody-5c1ba3bb130a78863510e6f62f9be51f83e94a95.zip
mod_c2s: Code reduction
-rw-r--r--plugins/mod_c2s.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 4d7318a5..682c4e3b 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -39,13 +39,12 @@ local default_stream_attr = { ["xmlns:stream"] = "http://etherx.jabber.org/strea
function stream_callbacks.streamopened(session, attr)
local send = session.send;
- session.host = attr.to;
+ session.host = nameprep(attr.to);
if not session.host then
session:close{ condition = "improper-addressing",
- text = "A 'to' attribute is required on stream headers" };
+ text = "A valid 'to' attribute is required on stream headers" };
return;
end
- session.host = nameprep(session.host);
session.version = tonumber(attr.version) or 0;
session.streamid = uuid_generate();
(session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host);