]> granicus.if.org Git - ejabberd/commitdiff
* src/ejabberd_router.erl (do_route/3): Slightly changed behaviour
authorAlexey Shchepin <alexey@process-one.net>
Sat, 3 Jan 2004 17:25:21 +0000 (17:25 +0000)
committerAlexey Shchepin <alexey@process-one.net>
Sat, 3 Jan 2004 17:25:21 +0000 (17:25 +0000)
SVN Revision: 195

ChangeLog
src/ejabberd_router.erl

index 271a23a3fb29c16c8fa4d429140438bb5a0deb8b..f81cf587e838409ae18cd48c70ad3991b4b4eb0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index fcc89375b06eddda0e0d1d0bb0f29ec4f6b61194..74352254de69c9ea49b40fd10a2277d2bf4eba8d 100644 (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}