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 | |
parent | * src/ejabberd_sm.erl (do_route/3): Minor fix (diff) |
* src/ejabberd_router.erl (do_route/3): Slightly changed behaviour
SVN Revision: 195
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/ejabberd_router.erl | 6 |
2 files changed, 9 insertions, 1 deletions
@@ -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 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} |