25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-06 15:37:52 +01:00

Add new domain_balancing criteria: broadcast

This commit is contained in:
Evgeniy Khramtsov 2011-09-14 17:40:06 +10:00
parent b0b371d23a
commit d6e81ac06b

View File

@ -378,9 +378,21 @@ do_route(OrigFrom, OrigTo, OrigPacket) ->
jlib:jid_tolower(From)); jlib:jid_tolower(From));
bare_destination -> bare_destination ->
jlib:jid_remove_resource( jlib:jid_remove_resource(
jlib:jid_tolower(To)) jlib:jid_tolower(To));
broadcast ->
broadcast
end, end,
case get_component_number(LDstDomain) of case get_component_number(LDstDomain) of
_ when Value == broadcast ->
lists:foreach(
fun(R) ->
Pid = R#route.pid,
if is_pid(Pid) ->
Pid ! {route, From, To, Packet};
true ->
drop
end
end, Rs);
undefined -> undefined ->
case [R || R <- Rs, node(R#route.pid) == node()] of case [R || R <- Rs, node(R#route.pid) == node()] of
[] -> [] ->