Commit 66dcd908 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed routing of packets to bare JID addresses.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@674 b35dd754-fafc-0310-a699-88a17e54d16e
parent af4cd223
...@@ -78,7 +78,8 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -78,7 +78,8 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
Object item = ((Hashtable)nameRoutes).put(node.getNode(), Object item = ((Hashtable)nameRoutes).put(node.getNode(),
resourceRoutes); resourceRoutes);
if (item instanceof ChannelHandler) { if (item instanceof ChannelHandler) {
route = (ChannelHandler)item; // Associate the previous Route with the bare JID
((Hashtable)resourceRoutes).put("", item);
} }
} }
Object resourceRoute = Object resourceRoute =
...@@ -96,7 +97,6 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -96,7 +97,6 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
routeLock.writeLock().unlock(); routeLock.writeLock().unlock();
} }
//System.err.println(node.toString() + " added");
return route; return route;
} }
...@@ -114,11 +114,10 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable { ...@@ -114,11 +114,10 @@ public class RoutingTableImpl extends BasicModule implements RoutingTable {
route = (RoutableChannelHandler)resourceRoutes; route = (RoutableChannelHandler)resourceRoutes;
} }
else if (resourceRoutes != null) { else if (resourceRoutes != null) {
route = (RoutableChannelHandler) String resource = node.getResource() == null ? "" : node.getResource();
((Hashtable)resourceRoutes).get(node.getResource()); route = (RoutableChannelHandler) ((Hashtable)resourceRoutes).get(resource);
} }
else { else {
//System.err.println(nameRoutes);
throw new NoSuchRouteException(node.toString()); throw new NoSuchRouteException(node.toString());
} }
} }
......
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