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

Refactoring of NoSuchRouteException. JM-476

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3137 b35dd754-fafc-0310-a699-88a17e54d16e
parent f10b96ca
......@@ -46,12 +46,13 @@ public class SocketPacketWriteHandler implements ChannelHandler {
JID recipient = packet.getTo();
// Check if the target domain belongs to a remote server or a component
if (server.matchesComponent(recipient) || server.isRemote(recipient)) {
try {
// Locate the route to the remote server or component and ask it
// to process the packet
routingTable.getRoute(recipient).process(packet);
ChannelHandler route = routingTable.getRoute(recipient);
if (route != null) {
route.process(packet);
}
catch (NoSuchRouteException e) {
else {
// No root was found so either drop or store the packet
handleUnprocessedPacket(packet);
}
......
......@@ -556,20 +556,14 @@ public abstract class SocketReader implements Runnable {
return false;
}
// Check if the host matches a subdomain of this host
RoutableChannelHandler route = null;
try {
route = routingTable.getRoute(new JID(host));
if (route instanceof OutgoingSessionPromise) {
RoutableChannelHandler route = routingTable.getRoute(new JID(host));
if (route == null || route instanceof OutgoingSessionPromise) {
return true;
}
else {
return false;
}
}
catch (NoSuchRouteException e) {
return true;
}
}
/**
* Tries to secure the connection using TLS. If the connection is secured then reset
......
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