diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 33563740d..c7be11e63 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -221,8 +221,10 @@ stop_or_detach(FsmRef) -> end. -migrate(FsmRef, Node, After) -> - erlang:send_after(After, FsmRef, {migrate, Node}). +migrate(FsmRef, Node, After) when node(FsmRef) == node() -> + erlang:send_after(After, FsmRef, {migrate, Node}); +migrate(_FsmRef, _Node, _After) -> + ok. migrate_shutdown(FsmRef, Node, After) -> FsmRef ! {migrate_shutdown, Node, After}. diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index 6c139d5c5..77142ee67 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -117,8 +117,10 @@ start_link(StateName, StateData) -> (?GEN_FSM):start_link(?MODULE, [StateName, StateData], ?FSMOPTS). -migrate(FsmRef, Node, After) -> - erlang:send_after(After, FsmRef, {migrate, Node}). +migrate(FsmRef, Node, After) when node(FsmRef) == node() -> + erlang:send_after(After, FsmRef, {migrate, Node}); +migrate(_FsmRef, _Node, _After) -> + ok. moderate_room_history(FsmRef, Nick) -> (?GEN_FSM):sync_send_all_state_event(FsmRef, diff --git a/src/web/ejabberd_bosh.erl b/src/web/ejabberd_bosh.erl index c33b058a0..2264aa0eb 100644 --- a/src/web/ejabberd_bosh.erl +++ b/src/web/ejabberd_bosh.erl @@ -206,8 +206,10 @@ sockname(_Socket) -> {ok, {{0, 0, 0, 0}, 0}}. peername({http_bind, _FsmRef, IP}) -> {ok, IP}. -migrate(FsmRef, Node, After) -> - erlang:send_after(After, FsmRef, {migrate, Node}). +migrate(FsmRef, Node, After) when node(FsmRef) == node() -> + erlang:send_after(After, FsmRef, {migrate, Node}); +migrate(_FsmRef, _Node, _After) -> + ok. process_request(Data, IP, Type) -> Opts1 = ejabberd_c2s_config:get_c2s_limits(),