Commit fbb3eb6f authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed component lookup when JID belongs to a remote server but its subdomain...

Fixed component lookup when JID belongs to a remote server but its subdomain matches a local component. JM-473

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3126 b35dd754-fafc-0310-a699-88a17e54d16e
parent faabfd13
...@@ -12,21 +12,20 @@ ...@@ -12,21 +12,20 @@
package org.jivesoftware.messenger.component; package org.jivesoftware.messenger.component;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.messenger.PacketException;
import org.jivesoftware.messenger.PacketRouter;
import org.jivesoftware.messenger.RoutableChannelHandler;
import org.jivesoftware.messenger.XMPPServer;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log;
import org.xmpp.component.Component; import org.xmpp.component.Component;
import org.xmpp.component.ComponentException;
import org.xmpp.component.ComponentManager; import org.xmpp.component.ComponentManager;
import org.xmpp.component.ComponentManagerFactory; import org.xmpp.component.ComponentManagerFactory;
import org.xmpp.component.ComponentException;
import org.xmpp.packet.IQ; import org.xmpp.packet.IQ;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.xmpp.packet.Packet; import org.xmpp.packet.Packet;
import org.xmpp.packet.Presence; import org.xmpp.packet.Presence;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.messenger.component.ComponentSession;
import org.jivesoftware.messenger.RoutableChannelHandler;
import org.jivesoftware.messenger.XMPPServer;
import org.jivesoftware.messenger.PacketRouter;
import org.jivesoftware.messenger.PacketException;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
...@@ -219,11 +218,14 @@ public class InternalComponentManager implements ComponentManager, RoutableChann ...@@ -219,11 +218,14 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
return components.get(jid); return components.get(jid);
} }
else { else {
if (!jid.contains(serverDomain)) {
// Ignore JIDs that doesn't belong to this server
return null;
}
String serverName = new JID(jid).getDomain(); String serverName = new JID(jid).getDomain();
int index = serverName.indexOf("."); int index = serverName.indexOf(".");
if (index != -1) { if (index != -1) {
String serviceName = serverName.substring(0, index); jid = serverName.substring(0, index);
jid = serviceName;
} }
} }
return components.get(jid); return components.get(jid);
......
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