* src/ejabberd_router.erl (do_route/3): Slightly changed behaviour

SVN Revision: 195
This commit is contained in:
Alexey Shchepin 2004-01-03 17:25:21 +00:00
parent 7e6d96b192
commit 5d7f5c3a79
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -80,7 +80,11 @@ do_route(From, To, Packet) ->
?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}