From d6e81ac06b931cba493e39c0f860250b2ac08293 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 14 Sep 2011 17:40:06 +1000 Subject: [PATCH] Add new domain_balancing criteria: broadcast --- src/ejabberd_router.erl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_router.erl b/src/ejabberd_router.erl index 672bdbe0f..e9d362821 100644 --- a/src/ejabberd_router.erl +++ b/src/ejabberd_router.erl @@ -378,9 +378,21 @@ do_route(OrigFrom, OrigTo, OrigPacket) -> jlib:jid_tolower(From)); bare_destination -> jlib:jid_remove_resource( - jlib:jid_tolower(To)) + jlib:jid_tolower(To)); + broadcast -> + broadcast end, 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 -> case [R || R <- Rs, node(R#route.pid) == node()] of [] ->