+2004-01-03 Alexey Shchepin <alexey@sevcom.net>
+
+ * src/ejabberd_router.erl (do_route/3): Slightly changed behaviour
+
2004-01-01 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_sm.erl (do_route/3): Minor fix
?DEBUG("routed to process ~p~n", [Pid]),
Pid ! {route, From, To, Packet};
Rs ->
- R = lists:nth(erlang:phash(now(), length(Rs)), Rs),
+ Rs1 = case [R || R <- Rs, node(R#route.pid) == node()] of
+ [] -> Rs;
+ LRs -> LRs
+ end,
+ R = lists:nth(erlang:phash(now(), length(Rs1)), Rs1),
Pid = R#route.pid,
?DEBUG("routed to process ~p~n", [Pid]),
Pid ! {route, From, To, Packet}