diff --git a/CHANGELOG.md b/CHANGELOG.md index 311009faa..870c3c18a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ emqttd ChangeLog ================== +0.9.3-alpha (2015-07-25) +------------------------- + +Wiki: [Bridge](https://github.com/emqtt/emqttd/wiki/Bridge) + +Improve: emqttd_protocol.hrl to define 'QOS_I' + +Improve: emqttd_pubsub to add subscribe/2 API + +Improve: ./bin/emqttd_ctl to support new bridges command + +Bugfix: issue #206 - Cannot bridge two nodes + + 0.9.2-alpha (2015-07-18) ------------------------- diff --git a/src/emqttd_bridge_sup.erl b/src/emqttd_bridge_sup.erl index d7ffc0f80..0df4b1343 100644 --- a/src/emqttd_bridge_sup.erl +++ b/src/emqttd_bridge_sup.erl @@ -24,6 +24,7 @@ %%% %%% @end %%%----------------------------------------------------------------------------- + -module(emqttd_bridge_sup). -author("Feng Lee "). @@ -63,8 +64,13 @@ start_bridge(Node, SubTopic) when is_atom(Node) and is_binary(SubTopic) -> -spec start_bridge(atom(), binary(), [emqttd_bridge:option()]) -> {ok, pid()} | {error, any()}. start_bridge(Node, SubTopic, Options) when is_atom(Node) and is_binary(SubTopic) -> - Options1 = emqttd_opts:merge(emqttd_broker:env(bridge), Options), - supervisor:start_child(?MODULE, bridge_spec(Node, SubTopic, Options1)). + case Node =:= node() of + true -> + {error, bridge_to_self}; + false -> + Options1 = emqttd_opts:merge(emqttd_broker:env(bridge), Options), + supervisor:start_child(?MODULE, bridge_spec(Node, SubTopic, Options1)) + end. %%------------------------------------------------------------------------------ %% @doc Stop a bridge