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 @@ ...@@ -3,7 +3,7 @@
* $Revision: 2747 $ * $Revision: 2747 $
* $Date: 2005-08-31 15:12:28 -0300 (Wed, 31 Aug 2005) $ * $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), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -14,7 +14,6 @@ package org.jivesoftware.wildfire.handler; ...@@ -14,7 +14,6 @@ package org.jivesoftware.wildfire.handler;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.QName; import org.dom4j.QName;
import org.jivesoftware.stringprep.Stringprep;
import org.jivesoftware.stringprep.StringprepException; import org.jivesoftware.stringprep.StringprepException;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
...@@ -23,6 +22,8 @@ import org.jivesoftware.wildfire.*; ...@@ -23,6 +22,8 @@ import org.jivesoftware.wildfire.*;
import org.jivesoftware.wildfire.auth.AuthFactory; import org.jivesoftware.wildfire.auth.AuthFactory;
import org.jivesoftware.wildfire.auth.AuthToken; import org.jivesoftware.wildfire.auth.AuthToken;
import org.jivesoftware.wildfire.auth.UnauthorizedException; 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.UserManager;
import org.jivesoftware.wildfire.user.UserNotFoundException; import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.xmpp.packet.IQ; import org.xmpp.packet.IQ;
...@@ -165,7 +166,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo { ...@@ -165,7 +166,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
String resource = iq.elementTextTrim("resource"); String resource = iq.elementTextTrim("resource");
if (resource != null) { if (resource != null) {
try { try {
resource = Stringprep.resourceprep(resource); resource = JID.resourceprep(resource);
} }
catch (StringprepException e) { catch (StringprepException e) {
throw new IllegalArgumentException("Invalid resource: " + resource); throw new IllegalArgumentException("Invalid resource: " + resource);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* $Revision: $ * $Revision: $
* $Date: $ * $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), * This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution. * a copy of which is included in this distribution.
...@@ -12,13 +12,17 @@ ...@@ -12,13 +12,17 @@
package org.jivesoftware.wildfire.handler; package org.jivesoftware.wildfire.handler;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.stringprep.Stringprep;
import org.jivesoftware.stringprep.StringprepException; import org.jivesoftware.stringprep.StringprepException;
import org.jivesoftware.util.Log; 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.AuthToken;
import org.jivesoftware.wildfire.auth.UnauthorizedException; import org.jivesoftware.wildfire.auth.UnauthorizedException;
import org.jivesoftware.wildfire.session.ClientSession;
import org.xmpp.packet.IQ; import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.PacketError; import org.xmpp.packet.PacketError;
import org.xmpp.packet.StreamError; import org.xmpp.packet.StreamError;
...@@ -70,7 +74,7 @@ public class IQBindHandler extends IQHandler { ...@@ -70,7 +74,7 @@ public class IQBindHandler extends IQHandler {
else { else {
// Check that the desired resource is valid // Check that the desired resource is valid
try { try {
resource = Stringprep.resourceprep(resource); resource = JID.resourceprep(resource);
} }
catch (StringprepException e) { catch (StringprepException e) {
reply.setChildElement(packet.getChildElement().createCopy()); 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