diff options
author | Alexey Shchepin <alexey@process-one.net> | 2004-01-03 17:25:21 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2004-01-03 17:25:21 +0000 |
commit | 5d7f5c3a7913e1dac3cbb3d206f2a4b8ceb592f6 (patch) | |
tree | 490cfcf91d673bbdb3f58450cec2545ae2de67ff /src | |
parent | * src/ejabberd_sm.erl (do_route/3): Minor fix (diff) |
* src/ejabberd_router.erl (do_route/3): Slightly changed behaviour
SVN Revision: 195
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd_router.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index fcc89375..74352254 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -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} |