plugins/mod_c2s.lua
changeset 4551 8f25f3b1c62f
parent 4548 e6e5c76ff009
child 4610 171051f9dd00
--- a/plugins/mod_c2s.lua	Mon Jan 23 01:05:32 2012 +0000
+++ b/plugins/mod_c2s.lua	Mon Jan 23 02:15:28 2012 +0000
@@ -39,13 +39,12 @@
 
 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);