Commit 2425c6fb authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Do not attempt s2s for known external components. JM-1417. Reviewer=Gabriel

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10632 b35dd754-fafc-0310-a699-88a17e54d16e
parent bcd3f0b2
...@@ -155,6 +155,18 @@ public class ExternalComponentManager { ...@@ -155,6 +155,18 @@ public class ExternalComponentManager {
} }
} }
/**
* Returns true if there is a configuration for the specified subdomain. This
* checking can be used as an indirect way of checking that the specified
* subdomain belongs to an external component.
*
* @param subdomain the subdomain of the external component.
* @return true if there is a configuration for the specified subdomain.
*/
public static boolean hasConfiguration(String subdomain) {
return getConfiguration(subdomain, true) != null;
}
/** /**
* Returns the list of registered external components that are allowed to connect to this * Returns the list of registered external components that are allowed to connect to this
* server when using a whitelist policy. However, when using a blacklist policy (i.e. anyone * server when using a whitelist policy. However, when using a blacklist policy (i.e. anyone
......
...@@ -17,6 +17,7 @@ import org.jivesoftware.openfire.auth.UnauthorizedException; ...@@ -17,6 +17,7 @@ import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.cluster.ClusterEventListener; import org.jivesoftware.openfire.cluster.ClusterEventListener;
import org.jivesoftware.openfire.cluster.ClusterManager; import org.jivesoftware.openfire.cluster.ClusterManager;
import org.jivesoftware.openfire.cluster.NodeID; import org.jivesoftware.openfire.cluster.NodeID;
import org.jivesoftware.openfire.component.ExternalComponentManager;
import org.jivesoftware.openfire.container.BasicModule; import org.jivesoftware.openfire.container.BasicModule;
import org.jivesoftware.openfire.handler.PresenceUpdateHandler; import org.jivesoftware.openfire.handler.PresenceUpdateHandler;
import org.jivesoftware.openfire.server.OutgoingSessionPromise; import org.jivesoftware.openfire.server.OutgoingSessionPromise;
...@@ -249,7 +250,8 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust ...@@ -249,7 +250,8 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable, Clust
} }
} }
} }
else if (jid.getDomain().contains(serverName) && hasComponentRoute(jid)) { else if (jid.getDomain().contains(serverName) &&
(hasComponentRoute(jid) || ExternalComponentManager.hasConfiguration(jid.getDomain()))) {
// Packet sent to component hosted in this server // Packet sent to component hosted in this server
// First check if the component is being hosted in this JVM // First check if the component is being hosted in this JVM
RoutableChannelHandler route = localRoutingTable.getRoute(jid.getDomain()); RoutableChannelHandler route = localRoutingTable.getRoute(jid.getDomain());
......
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