Commit 5d9b8442 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Optimization - Avoid stringprep whenever possible. JM-925

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6554 b35dd754-fafc-0310-a699-88a17e54d16e
parent b9724963
......@@ -3,7 +3,7 @@
* $Revision: 2747 $
* $Date: 2005-08-31 15:12:28 -0300 (Wed, 31 Aug 2005) $
*
* Copyright (C) 2004 Jive Software. All rights reserved.
* Copyright (C) 2007 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
......@@ -14,7 +14,6 @@ package org.jivesoftware.wildfire.handler;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.stringprep.Stringprep;
import org.jivesoftware.stringprep.StringprepException;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils;
......@@ -23,6 +22,8 @@ import org.jivesoftware.wildfire.*;
import org.jivesoftware.wildfire.auth.AuthFactory;
import org.jivesoftware.wildfire.auth.AuthToken;
import org.jivesoftware.wildfire.auth.UnauthorizedException;
import org.jivesoftware.wildfire.session.ClientSession;
import org.jivesoftware.wildfire.session.Session;
import org.jivesoftware.wildfire.user.UserManager;
import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.xmpp.packet.IQ;
......@@ -165,7 +166,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
String resource = iq.elementTextTrim("resource");
if (resource != null) {
try {
resource = Stringprep.resourceprep(resource);
resource = JID.resourceprep(resource);
}
catch (StringprepException e) {
throw new IllegalArgumentException("Invalid resource: " + resource);
......
......@@ -3,7 +3,7 @@
* $Revision: $
* $Date: $
*
* Copyright (C) 2005 Jive Software. All rights reserved.
* Copyright (C) 2007 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
......@@ -12,13 +12,17 @@
package org.jivesoftware.wildfire.handler;
import org.dom4j.Element;
import org.jivesoftware.stringprep.Stringprep;
import org.jivesoftware.stringprep.StringprepException;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.*;
import org.jivesoftware.wildfire.Connection;
import org.jivesoftware.wildfire.IQHandlerInfo;
import org.jivesoftware.wildfire.SessionManager;
import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.wildfire.auth.AuthToken;
import org.jivesoftware.wildfire.auth.UnauthorizedException;
import org.jivesoftware.wildfire.session.ClientSession;
import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.StreamError;
......@@ -70,7 +74,7 @@ public class IQBindHandler extends IQHandler {
else {
// Check that the desired resource is valid
try {
resource = Stringprep.resourceprep(resource);
resource = JID.resourceprep(resource);
}
catch (StringprepException e) {
reply.setChildElement(packet.getChildElement().createCopy());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment