Changeset

930:fed53329818d

Fixed: sessionmanager: Apply nameprep on hostname passed in stream tag (part of issue #57)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 30 Mar 2009 03:03:06 +0500
parents 929:b4f2ca7f6f00
children 931:4514ed5ee943
files core/sessionmanager.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/sessionmanager.lua	Mon Mar 30 02:56:34 2009 +0500
+++ b/core/sessionmanager.lua	Mon Mar 30 03:03:06 2009 +0500
@@ -23,6 +23,7 @@
 local uuid_generate = require "util.uuid".generate;
 local rm_load_roster = require "core.rostermanager".load_roster;
 local config_get = require "core.configmanager".get;
+local nameprep = require "util.encodings".stringprep.nameprep;
 
 local fire_event = require "core.eventmanager".fire_event;
 
@@ -156,6 +157,7 @@
 function streamopened(session, attr)
 						local send = session.send;
 						session.host = attr.to or error("Client failed to specify destination hostname");
+						session.host = nameprep(session.host);
 			                        session.version = tonumber(attr.version) or 0;
 			                        session.streamid = m_random(1000000, 99999999);
 			                        (session.log or session)("debug", "Client sent opening <stream:stream> to %s", session.host);