From 00863acea370e0367824201c6bc850515ada1889 Mon Sep 17 00:00:00 2001 From: turtleDeng Date: Fri, 25 Jan 2019 13:01:48 +0800 Subject: [PATCH 1/7] Merge emqx30 (#2181) * Change the reason code in will topic acl check (#2168) * Fix bridge bug (#2160) * Limit bridge QoS less than 1 * Improve shared sub dispatch implementation. (#2144) * Upgrade ekka, esockd libraries * Improve the 'try_open_session' function * Reload config (#2180) --- Makefile | 4 +- rebar.config | 4 +- src/emqx.erl | 16 ++++++- src/emqx_bridge.erl | 57 ++++++++++++++-------- src/emqx_protocol.erl | 88 ++++++++++++++++------------------ src/emqx_session.erl | 2 +- src/emqx_shared_sub.erl | 48 +++++++++++-------- test/emqx_shared_sub_SUITE.erl | 17 ++++++- 8 files changed, 140 insertions(+), 96 deletions(-) diff --git a/Makefile b/Makefile index b07092c91..16c9795b1 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ DEPS = jsx gproc gen_rpc ekka esockd cowboy replayq dep_jsx = hex-emqx 2.9.0 dep_gproc = hex-emqx 0.8.0 dep_gen_rpc = git-emqx https://github.com/emqx/gen_rpc 2.3.0 -dep_esockd = git-emqx https://github.com/emqx/esockd v5.4.3 -dep_ekka = git-emqx https://github.com/emqx/ekka v0.5.1 +dep_esockd = git-emqx https://github.com/emqx/esockd v5.4.4 +dep_ekka = git-emqx https://github.com/emqx/ekka v0.5.3 dep_cowboy = hex-emqx 2.4.0 dep_replayq = git-emqx https://github.com/emqx/replayq v0.1.1 diff --git a/rebar.config b/rebar.config index 993790aa9..7486e7267 100644 --- a/rebar.config +++ b/rebar.config @@ -6,9 +6,9 @@ %% appended to deps in rebar.config.script {github_emqx_deps, [{gen_rpc, "2.3.0"}, - {ekka, "v0.5.1"}, + {ekka, "v0.5.3"}, {replayq, "v0.1.1"}, - {esockd, "v5.4.3"}, + {esockd, "v5.4.4"}, {cuttlefish, "v2.2.1"} ]}. diff --git a/src/emqx.erl b/src/emqx.erl index 76e966a59..728b35cfc 100644 --- a/src/emqx.erl +++ b/src/emqx.erl @@ -17,7 +17,7 @@ -include("emqx.hrl"). %% Start/Stop the application --export([start/0, is_running/1, stop/0]). +-export([start/0, restart/1, is_running/1, stop/0]). %% PubSub API -export([subscribe/1, subscribe/2, subscribe/3]). @@ -47,6 +47,12 @@ start() -> %% Check Mnesia application:ensure_all_started(?APP). +-spec(restart(string()) -> ok). +restart(ConfFile) -> + reload_config(ConfFile), + shutdown(), + reboot(). + %% @doc Stop emqx application. -spec(stop() -> ok | {error, term()}). stop() -> @@ -158,3 +164,11 @@ shutdown(Reason) -> reboot() -> lists:foreach(fun application:start/1, [gproc, esockd, ranch, cowboy, ekka, emqx]). +%%------------------------------------------------------------------------------ +%% Internal functions +%%------------------------------------------------------------------------------ +reload_config(ConfFile) -> + {ok, [Conf]} = file:consult(ConfFile), + lists:foreach(fun({App, Vals}) -> + [application:set_env(App, Par, Val) || {Par, Val} <- Vals] + end, Conf). diff --git a/src/emqx_bridge.erl b/src/emqx_bridge.erl index 133b3b621..5d3ae3e91 100644 --- a/src/emqx_bridge.erl +++ b/src/emqx_bridge.erl @@ -114,12 +114,12 @@ init([Options]) -> ReconnectInterval = get_value(reconnect_interval, Options, 30000), Mountpoint = format_mountpoint(get_value(mountpoint, Options)), QueueOptions = get_value(queue, Options), - {ok, #state{mountpoint = Mountpoint, - queue_option = QueueOptions, - readq = [], - writeq = [], - options = Options, - reconnect_interval = ReconnectInterval}}. + {ok, #state{mountpoint = Mountpoint, + queue_option = QueueOptions, + readq = [], + writeq = [], + options = Options, + reconnect_interval = ReconnectInterval}}. handle_call(start_bridge, _From, State = #state{client_pid = undefined}) -> {Msg, NewState} = bridge(start, State), @@ -228,16 +228,19 @@ handle_info(replay, State = #state{client_pid = ClientPid, readq = ReadQ}) -> %%---------------------------------------------------------------- %% received local node message %%---------------------------------------------------------------- -handle_info({dispatch, _, #message{topic = Topic, payload = Payload, flags = #{retain := Retain}}}, +handle_info({dispatch, _, #message{topic = Topic, qos = QoS, payload = Payload, flags = #{retain := Retain}}}, State = #state{client_pid = undefined, - mountpoint = Mountpoint}) -> + mountpoint = Mountpoint}) + when QoS =< 1 -> Msg = #mqtt_msg{qos = 1, retain = Retain, topic = mountpoint(Mountpoint, Topic), payload = Payload}, {noreply, en_writeq({undefined, Msg}, State)}; -handle_info({dispatch, _, #message{topic = Topic, payload = Payload, flags = #{retain := Retain}}}, - State = #state{client_pid = Pid, mountpoint = Mountpoint}) -> +handle_info({dispatch, _, #message{topic = Topic, qos = QoS ,payload = Payload, flags = #{retain := Retain}}}, + State = #state{client_pid = Pid, + mountpoint = Mountpoint}) + when QoS =< 1 -> Msg = #mqtt_msg{qos = 1, retain = Retain, topic = mountpoint(Mountpoint, Topic), @@ -347,7 +350,6 @@ format_mountpoint(undefined) -> format_mountpoint(Prefix) -> binary:replace(bin(Prefix), <<"${node}">>, atom_to_binary(node(), utf8)). - en_writeq(Msg, State = #state{replayq = ReplayQ, queue_option = #{mem_cache := false}}) -> NewReplayQ = replayq:append(ReplayQ, [Msg]), @@ -369,16 +371,21 @@ publish_readq_msg(ClientPid, [{_PktId, Msg} | ReadQ], NewReadQ) -> publish_readq_msg(ClientPid, ReadQ, [{PktId, Msg} | NewReadQ]). delete(PktId, State = #state{ replayq = ReplayQ, - queue_option = #{ mem_cache := false }}) -> + readq = [], + queue_option = #{ mem_cache := false}}) -> {NewReplayQ, NewAckRef, Msgs} = replayq:pop(ReplayQ, #{count_limit => 1}), + logger:debug("[Msg] PacketId ~p, Msg: ~p", [PktId, Msgs]), + ok = replayq:ack(NewReplayQ, NewAckRef), case Msgs of - [{PktId, Msg}] -> - logger:debug("[Msg] PacketId ~p, Msg: ~p", [PktId, Msg]), - replayq:ack(ReplayQ, NewAckRef), - State#state{ replayq = NewReplayQ, ackref = NewAckRef}; - _ -> + [{PktId, _Msg}] -> self() ! pop, - State + State#state{ replayq = NewReplayQ, ackref = NewAckRef }; + [{_PktId, _Msg}] -> + NewReplayQ1 = replayq:append(NewReplayQ, Msgs), + self() ! pop, + State#state{ replayq = NewReplayQ1, ackref = NewAckRef }; + _Empty -> + State#state{ replayq = NewReplayQ, ackref = NewAckRef} end; delete(_PktId, State = #state{readq = [], writeq = [], replayq = ReplayQ, ackref = AckRef}) -> ok = replayq:ack(ReplayQ, AckRef), @@ -388,8 +395,16 @@ delete(_PktId, State = #state{readq = [], writeq = [], replayq = ReplayQ, ackref delete(PktId, State = #state{readq = [], writeq = WriteQ}) -> State#state{writeq = lists:keydelete(PktId, 1, WriteQ)}; -delete(PktId, State = #state{readq = ReadQ}) -> - State#state{readq = lists:keydelete(PktId, 1, ReadQ)}. +delete(PktId, State = #state{readq = ReadQ, replayq = ReplayQ, ackref = AckRef}) -> + NewReadQ = lists:keydelete(PktId, 1, ReadQ), + case NewReadQ of + [] -> + ok = replayq:ack(ReplayQ, AckRef), + self() ! pop; + _NewReadQ -> + ok + end, + State#state{ readq = NewReadQ }. bridge(Action, State = #state{options = Options, replayq = ReplayQ, @@ -397,7 +412,7 @@ bridge(Action, State = #state{options = Options, = QueueOption = #{batch_size := BatchSize}}) when BatchSize > 0 -> - case emqx_client:start_link([{owner, self()}|options(Options)]) of + case emqx_client:start_link([{owner, self()} | options(Options)]) of {ok, ClientPid} -> case emqx_client:connect(ClientPid) of {ok, _} -> diff --git a/src/emqx_protocol.erl b/src/emqx_protocol.erl index 8aafb313f..9b9ef7f7d 100644 --- a/src/emqx_protocol.erl +++ b/src/emqx_protocol.erl @@ -21,6 +21,7 @@ -export([init/2]). -export([info/1]). -export([attrs/1]). +-export([attr/2]). -export([caps/1]). -export([stats/1]). -export([client_id/1]). @@ -162,6 +163,28 @@ attrs(#pstate{zone = Zone, {is_bridge, IsBridge}, {connected_at, ConnectedAt}]. +attr(max_inflight, #pstate{proto_ver = ?MQTT_PROTO_V5, conn_props = ConnProps}) -> + get_property('Receive-Maximum', ConnProps, 65535); +attr(max_inflight, #pstate{zone = Zone}) -> + emqx_zone:get_env(Zone, max_inflight, 65535); +attr(expiry_interval, #pstate{proto_ver = ?MQTT_PROTO_V5, conn_props = ConnProps}) -> + get_property('Session-Expiry-Interval', ConnProps, 0); +attr(expiry_interval, #pstate{zone = Zone, clean_start = CleanStart}) -> + case CleanStart of + true -> 0; + false -> emqx_zone:get_env(Zone, session_expiry_interval, 16#ffffffff) + end; +attr(topic_alias_maximum, #pstate{proto_ver = ?MQTT_PROTO_V5, conn_props = ConnProps}) -> + get_property('Topic-Alias-Maximum', ConnProps, 0); +attr(topic_alias_maximum, #pstate{zone = Zone}) -> + emqx_zone:get_env(Zone, max_topic_alias, 0); +attr(Name, PState) -> + Attrs = lists:zip(record_info(fields, pstate), tl(tuple_to_list(PState))), + case lists:keyfind(Name, 1, Attrs) of + {_, Value} -> Value; + false -> undefined + end. + caps(#pstate{zone = Zone}) -> emqx_mqtt_caps:get_caps(Zone). @@ -348,8 +371,8 @@ process_packet(?CONNECT_PACKET( PState3 = maybe_assign_client_id(PState2#pstate{is_super = IsSuper}), emqx_logger:set_metadata_client_id(PState3#pstate.client_id), %% Open session - SessAttrs = lists:foldl(fun set_session_attrs/2, #{will_msg => make_will_msg(ConnPkt)}, [{max_inflight, PState3}, {expiry_interval, PState3}, {misc, PState3}]), - case try_open_session(SessAttrs) of + SessAttrs = #{will_msg => make_will_msg(ConnPkt)}, + case try_open_session(SessAttrs, PState3) of {ok, SPid, SP} -> PState4 = PState3#pstate{session = SPid, connected = true}, ok = emqx_cm:register_connection(client_id(PState4)), @@ -673,54 +696,26 @@ maybe_assign_client_id(PState = #pstate{client_id = <<>>, ack_props = AckProps}) maybe_assign_client_id(PState) -> PState. -try_open_session(SessAttrs = #{zone := _, - client_id := _, - conn_pid := _, - username := _, - will_msg := _, - clean_start := _}) -> - case emqx_sm:open_session(SessAttrs) of +try_open_session(SessAttrs, PState = #pstate{zone = Zone, + client_id = ClientId, + conn_pid = ConnPid, + username = Username, + clean_start = CleanStart}) -> + case emqx_sm:open_session( + maps:merge(#{zone => Zone, + client_id => ClientId, + conn_pid => ConnPid, + username => Username, + clean_start => CleanStart, + max_inflight => attr(max_inflight, PState), + expiry_interval => attr(expiry_interval, PState), + topic_alias_maximum => attr(topic_alias_maximum, PState)}, + SessAttrs)) of {ok, SPid} -> {ok, SPid, false}; Other -> Other end. - -set_session_attrs({max_inflight, #pstate{proto_ver = ?MQTT_PROTO_V5, conn_props = ConnProps}}, SessAttrs) -> - maps:put(max_inflight, get_property('Receive-Maximum', ConnProps, 65535), SessAttrs); - -set_session_attrs({max_inflight, #pstate{zone = Zone}}, SessAttrs) -> - maps:put(max_inflight, emqx_zone:get_env(Zone, max_inflight, 65535), SessAttrs); - -set_session_attrs({expiry_interval, #pstate{proto_ver = ?MQTT_PROTO_V5, conn_props = ConnProps}}, SessAttrs) -> - maps:put(expiry_interval, get_property('Session-Expiry-Interval', ConnProps, 0), SessAttrs); - -set_session_attrs({expiry_interval, #pstate{zone = Zone, clean_start = CleanStart}}, SessAttrs) -> - maps:put(expiry_interval, case CleanStart of - true -> 0; - false -> emqx_zone:get_env(Zone, session_expiry_interval, 16#ffffffff) - end, SessAttrs); - -set_session_attrs({topic_alias_maximum, #pstate{proto_ver = ?MQTT_PROTO_V5, conn_props = ConnProps}}, SessAttrs) -> - maps:put(topic_alias_maximum, get_property('Topic-Alias-Maximum', ConnProps, 0), SessAttrs); - -set_session_attrs({topic_alias_maximum, #pstate{zone = Zone}}, SessAttrs) -> - maps:put(topic_alias_maximum, emqx_zone:get_env(Zone, max_topic_alias, 0), SessAttrs); - -set_session_attrs({misc, #pstate{zone = Zone, - client_id = ClientId, - conn_pid = ConnPid, - username = Username, - clean_start = CleanStart}}, SessAttrs) -> - SessAttrs#{zone => Zone, - client_id => ClientId, - conn_pid => ConnPid, - username => Username, - clean_start => CleanStart}; - -set_session_attrs(_, SessAttrs) -> - SessAttrs. - authenticate(Credentials, Password) -> case emqx_access_control:authenticate(Credentials, Password) of ok -> {ok, false}; @@ -821,7 +816,7 @@ check_will_acl(#mqtt_packet_connect{will_topic = WillTopic}, PState) -> allow -> ok; deny -> ?LOG(warning, "Will message (to ~s) validation failed, acl denied", [WillTopic]), - {error, ?RC_UNSPECIFIED_ERROR} + {error, ?RC_NOT_AUTHORIZED} end. check_publish(Packet, PState) -> @@ -978,3 +973,4 @@ reason_codes_compat(unsuback, _ReasonCodes, _ProtoVer) -> undefined; reason_codes_compat(PktType, ReasonCodes, _ProtoVer) -> [emqx_reason_codes:compat(PktType, RC) || RC <- ReasonCodes]. + diff --git a/src/emqx_session.erl b/src/emqx_session.erl index 098d76c52..689d84b29 100644 --- a/src/emqx_session.erl +++ b/src/emqx_session.erl @@ -184,7 +184,7 @@ info(State = #state{conn_pid = ConnPid, {upgrade_qos, UpgradeQoS}, {inflight, Inflight}, {retry_interval, RetryInterval}, - {mqueue_len, MQueue}, + {mqueue_len, emqx_mqueue:len(MQueue)}, {awaiting_rel, AwaitingRel}, {max_awaiting_rel, MaxAwaitingRel}, {await_rel_timeout, AwaitRelTimeout}]. diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index 67f03a93c..e14963bc7 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -91,18 +91,12 @@ dispatch(Group, Topic, Delivery = #delivery{message = Msg, results = Results}, F case pick(strategy(), ClientId, Group, Topic, FailedSubs) of false -> Delivery; - SubPid -> - case do_dispatch(SubPid, Topic, Msg) of + {Type, SubPid} -> + case do_dispatch(SubPid, Topic, Msg, Type) of ok -> Delivery#delivery{results = [{dispatch, {Group, Topic}, 1} | Results]}; {error, _Reason} -> - %% failed to dispatch to this sub, try next - %% 'Reason' is discarded so far, meaning for QoS1/2 messages - %% if all subscribers are off line, the dispatch would faile - %% even if there are sessions not expired yet. - %% If required, we can make use of the 'no_connection' reason to perform - %% retry without requiring acks, so the messages can be delivered - %% to sessions of offline clients + %% Failed to dispatch to this sub, try next. dispatch(Group, Topic, Delivery, [SubPid | FailedSubs]) end end. @@ -115,19 +109,23 @@ strategy() -> ack_enabled() -> emqx_config:get_env(shared_dispatch_ack_enabled, false). -do_dispatch(SubPid, Topic, Msg) when SubPid =:= self() -> +do_dispatch(SubPid, Topic, Msg, _Type) when SubPid =:= self() -> %% Deadlock otherwise _ = erlang:send(SubPid, {dispatch, Topic, Msg}), ok; -do_dispatch(SubPid, Topic, Msg) -> - dispatch_per_qos(SubPid, Topic, Msg). +do_dispatch(SubPid, Topic, Msg, Type) -> + dispatch_per_qos(SubPid, Topic, Msg, Type). %% return either 'ok' (when everything is fine) or 'error' -dispatch_per_qos(SubPid, Topic, #message{qos = ?QOS_0} = Msg) -> +dispatch_per_qos(SubPid, Topic, #message{qos = ?QOS_0} = Msg, _Type) -> %% For QoS 0 message, send it as regular dispatch _ = erlang:send(SubPid, {dispatch, Topic, Msg}), ok; -dispatch_per_qos(SubPid, Topic, Msg) -> +dispatch_per_qos(SubPid, Topic, Msg, retry) -> + %% Retry implies all subscribers nack:ed, send again without ack + _ = erlang:send(SubPid, {dispatch, Topic, Msg}), + ok; +dispatch_per_qos(SubPid, Topic, Msg, fresh) -> case ack_enabled() of true -> dispatch_with_ack(SubPid, Topic, Msg); @@ -211,24 +209,32 @@ pick(sticky, ClientId, Group, Topic, FailedSubs) -> true -> %% the old subscriber is still alive %% keep using it for sticky strategy - Sub0; + {fresh, Sub0}; false -> %% randomly pick one for the first message - Sub = do_pick(random, ClientId, Group, Topic, FailedSubs), + {Type, Sub} = do_pick(random, ClientId, Group, Topic, [Sub0 | FailedSubs]), %% stick to whatever pick result erlang:put({shared_sub_sticky, Group, Topic}, Sub), - Sub + {Type, Sub} end; pick(Strategy, ClientId, Group, Topic, FailedSubs) -> do_pick(Strategy, ClientId, Group, Topic, FailedSubs). do_pick(Strategy, ClientId, Group, Topic, FailedSubs) -> - case subscribers(Group, Topic) -- FailedSubs of - [] -> false; - [Sub] -> Sub; - All -> pick_subscriber(Group, Topic, Strategy, ClientId, All) + All = subscribers(Group, Topic), + case All -- FailedSubs of + [] when FailedSubs =:= [] -> + %% Genuinely no subscriber + false; + [] -> + %% All offline? pick one anyway + {retry, pick_subscriber(Group, Topic, Strategy, ClientId, All)}; + Subs -> + %% More than one available + {fresh, pick_subscriber(Group, Topic, Strategy, ClientId, Subs)} end. +pick_subscriber(_Group, _Topic, _Strategy, _ClientId, [Sub]) -> Sub; pick_subscriber(Group, Topic, Strategy, ClientId, Subs) -> Nth = do_pick_subscriber(Group, Topic, Strategy, ClientId, length(Subs)), lists:nth(Nth, Subs). diff --git a/test/emqx_shared_sub_SUITE.erl b/test/emqx_shared_sub_SUITE.erl index dd0e20ad1..cc5a5f515 100644 --- a/test/emqx_shared_sub_SUITE.erl +++ b/test/emqx_shared_sub_SUITE.erl @@ -72,6 +72,9 @@ t_random_basic(_) -> %% out which member it picked, then close its connection %% send the second message, the message should be 'nack'ed %% by the sticky session and delivered to the 2nd session. +%% After the connection for the 2nd session is also closed, +%% i.e. when all clients are offline, the following message(s) +%% should be delivered randomly. t_no_connection_nack(_) -> ok = ensure_config(sticky), Publisher = <<"publisher">>, @@ -117,7 +120,7 @@ t_no_connection_nack(_) -> %% sleep then make synced calls to session processes to ensure that %% the connection pid's 'EXIT' message is propagated to the session process %% also to be sure sessions are still alive - timer:sleep(5), + timer:sleep(2), _ = emqx_session:info(SPid1), _ = emqx_session:info(SPid2), %% Now we know what is the other still alive connection @@ -128,11 +131,21 @@ t_no_connection_nack(_) -> SendF(Id), ?wait(Received(Id, TheOtherConnPid), 1000) end, PacketIdList), + %% Now close the 2nd (last connection) + emqx_mock_client:stop(TheOtherConnPid), + timer:sleep(2), + %% both sessions should have conn_pid = undefined + ?assertEqual({conn_pid, undefined}, lists:keyfind(conn_pid, 1, emqx_session:info(SPid1))), + ?assertEqual({conn_pid, undefined}, lists:keyfind(conn_pid, 1, emqx_session:info(SPid2))), + %% send more messages, but all should be queued in session state + lists:foreach(fun(Id) -> SendF(Id) end, PacketIdList), + {_, L1} = lists:keyfind(mqueue_len, 1, emqx_session:info(SPid1)), + {_, L2} = lists:keyfind(mqueue_len, 1, emqx_session:info(SPid2)), + ?assertEqual(length(PacketIdList), L1 + L2), %% clean up emqx_mock_client:close_session(PubConnPid), emqx_sm:close_session(SPid1), emqx_sm:close_session(SPid2), - emqx_mock_client:close_session(TheOtherConnPid), ok. t_random(_) -> From 31e95b56c47637c4767d8db852348a0cc1232a3b Mon Sep 17 00:00:00 2001 From: turtled Date: Tue, 29 Jan 2019 10:43:25 +0800 Subject: [PATCH 2/7] Update Copyright to 2019 --- README.md | 2 +- include/emqx.hrl | 4 ++-- include/emqx_mqtt.hrl | 2 +- include/logger.hrl | 2 +- src/emqx.erl | 2 +- src/emqx_access_control.erl | 2 +- src/emqx_access_rule.erl | 2 +- src/emqx_acl_cache.erl | 2 +- src/emqx_acl_internal.erl | 2 +- src/emqx_acl_mod.erl | 2 +- src/emqx_alarm_mgr.erl | 2 +- src/emqx_app.erl | 2 +- src/emqx_auth_mod.erl | 2 +- src/emqx_banned.erl | 2 +- src/emqx_base62.erl | 2 +- src/emqx_batch.erl | 2 +- src/emqx_bridge.erl | 2 +- src/emqx_bridge_sup.erl | 2 +- src/emqx_broker.erl | 2 +- src/emqx_broker_helper.erl | 2 +- src/emqx_broker_sup.erl | 2 +- src/emqx_cli.erl | 2 +- src/emqx_client.erl | 2 +- src/emqx_client_sock.erl | 2 +- src/emqx_cm.erl | 2 +- src/emqx_cm_sup.erl | 2 +- src/emqx_config.erl | 2 +- src/emqx_connection.erl | 2 +- src/emqx_ctl.erl | 2 +- src/emqx_flapping.erl | 2 +- src/emqx_frame.erl | 2 +- src/emqx_gc.erl | 2 +- src/emqx_gen_mod.erl | 2 +- src/emqx_guid.erl | 2 +- src/emqx_hooks.erl | 2 +- src/emqx_inflight.erl | 2 +- src/emqx_json.erl | 2 +- src/emqx_keepalive.erl | 2 +- src/emqx_kernel_sup.erl | 2 +- src/emqx_listeners.erl | 2 +- src/emqx_local_bridge.erl | 2 +- src/emqx_local_bridge_sup.erl | 2 +- src/emqx_local_bridge_sup_sup.erl | 2 +- src/emqx_logger.erl | 4 ++-- src/emqx_logger_formatter.erl | 2 +- src/emqx_message.erl | 2 +- src/emqx_metrics.erl | 2 +- src/emqx_misc.erl | 2 +- src/emqx_mod_presence.erl | 2 +- src/emqx_mod_rewrite.erl | 2 +- src/emqx_mod_subscription.erl | 2 +- src/emqx_mod_sup.erl | 2 +- src/emqx_modules.erl | 2 +- src/emqx_mountpoint.erl | 2 +- src/emqx_mqtt_caps.erl | 2 +- src/emqx_mqtt_props.erl | 2 +- src/emqx_mqtt_types.erl | 2 +- src/emqx_mqueue.erl | 2 +- src/emqx_packet.erl | 2 +- src/emqx_pd.erl | 2 +- src/emqx_plugins.erl | 2 +- src/emqx_pmon.erl | 2 +- src/emqx_pool.erl | 2 +- src/emqx_pool_sup.erl | 2 +- src/emqx_protocol.erl | 2 +- src/emqx_rate_limiter.erl | 2 +- src/emqx_reason_codes.erl | 2 +- src/emqx_router.erl | 2 +- src/emqx_router_helper.erl | 2 +- src/emqx_router_sup.erl | 2 +- src/emqx_rpc.erl | 2 +- src/emqx_sequence.erl | 2 +- src/emqx_session.erl | 2 +- src/emqx_session_sup.erl | 2 +- src/emqx_shared_sub.erl | 2 +- src/emqx_sm.erl | 2 +- src/emqx_sm_locker.erl | 2 +- src/emqx_sm_registry.erl | 2 +- src/emqx_sm_sup.erl | 2 +- src/emqx_stats.erl | 2 +- src/emqx_sup.erl | 2 +- src/emqx_sys.erl | 2 +- src/emqx_sys_mon.erl | 2 +- src/emqx_sys_sup.erl | 2 +- src/emqx_tables.erl | 2 +- src/emqx_time.erl | 2 +- src/emqx_topic.erl | 2 +- src/emqx_tracer.erl | 4 ++-- src/emqx_trie.erl | 2 +- src/emqx_types.erl | 2 +- src/emqx_vm.erl | 2 +- src/emqx_ws_connection.erl | 2 +- src/emqx_zone.erl | 2 +- test/emqx_SUITE.erl | 2 +- test/emqx_access_SUITE.erl | 2 +- test/emqx_acl_test_mod.erl | 2 +- test/emqx_auth_anonymous_test_mod.erl | 2 +- test/emqx_auth_dashboard.erl | 2 +- test/emqx_banned_SUITE.erl | 2 +- test/emqx_batch_SUITE.erl | 2 +- test/emqx_bridge_SUITE.erl | 2 +- test/emqx_broker_SUITE.erl | 2 +- test/emqx_client_SUITE.erl | 2 +- test/emqx_cm_SUITE.erl | 2 +- test/emqx_connection_SUITE.erl | 2 +- test/emqx_ct_broker_helpers.erl | 4 ++-- test/emqx_ct_helpers.erl | 2 +- test/emqx_frame_SUITE.erl | 2 +- test/emqx_gc_SUITE.erl | 2 +- test/emqx_guid_SUITE.erl | 2 +- test/emqx_hooks_SUITE.erl | 2 +- test/emqx_inflight_SUITE.erl | 2 +- test/emqx_json_SUITE.erl | 2 +- test/emqx_keepalive_SUITE.erl | 2 +- test/emqx_lib_SUITE.erl | 2 +- test/emqx_listeners_SUITE.erl | 2 +- test/emqx_message_SUITE.erl | 2 +- test/emqx_metrics_SUITE.erl | 2 +- test/emqx_misc_tests.erl | 2 +- test/emqx_mock_client.erl | 2 +- test/emqx_mod_SUITE.erl | 2 +- test/emqx_mod_rewrite_tests.erl | 2 +- test/emqx_mod_sup_SUITE.erl | 2 +- test/emqx_mountpoint_SUITE.erl | 2 +- test/emqx_mqtt_caps_SUITE.erl | 2 +- test/emqx_mqtt_packet_SUITE.erl | 2 +- test/emqx_mqtt_props_SUITE.erl | 2 +- test/emqx_mqueue_SUITE.erl | 2 +- test/emqx_net_SUITE.erl | 2 +- test/emqx_packet_SUITE.erl | 2 +- test/emqx_pd_SUITE.erl | 2 +- test/emqx_pmon_SUITE.erl | 2 +- test/emqx_pool_SUITE.erl | 2 +- test/emqx_pqueue_SUITE.erl | 2 +- test/emqx_protocol_SUITE.erl | 2 +- test/emqx_protocol_tests.erl | 2 +- test/emqx_reason_codes_tests.erl | 2 +- test/emqx_router_SUITE.erl | 2 +- test/emqx_sequence_SUITE.erl | 2 +- test/emqx_session_SUITE.erl | 2 +- test/emqx_shared_sub_SUITE.erl | 2 +- test/emqx_sm_SUITE.erl | 2 +- test/emqx_stats_tests.erl | 2 +- test/emqx_sys_mon_SUITE.erl | 2 +- test/emqx_tables_SUITE.erl | 2 +- test/emqx_time_SUITE.erl | 2 +- test/emqx_topic_SUITE.erl | 2 +- test/emqx_tracer_SUITE.erl | 4 ++-- test/emqx_trie_SUITE.erl | 2 +- test/emqx_vm_SUITE.erl | 2 +- test/emqx_ws_connection_SUITE.erl | 2 +- test/emqx_zone_SUITE.erl | 2 +- 152 files changed, 157 insertions(+), 157 deletions(-) diff --git a/README.md b/README.md index 8d03df8dd..1d5a9780a 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ You can read the mqtt protocol via the following links: ## License -Copyright (c) 2018 [EMQ Technologies Co., Ltd](http://emqtt.io). All Rights Reserved. +Copyright (c) 2013-2019 [EMQ Technologies Co., Ltd](http://emqtt.io). All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at diff --git a/include/emqx.hrl b/include/emqx.hrl index 84feb16b7..fba079b91 100644 --- a/include/emqx.hrl +++ b/include/emqx.hrl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ %% Banner %%-------------------------------------------------------------------- --define(COPYRIGHT, "Copyright (c) 2018 EMQ Technologies Co., Ltd"). +-define(COPYRIGHT, "Copyright (c) 2013-2019 EMQ Technologies Co., Ltd"). -define(LICENSE_MESSAGE, "Licensed under the Apache License, Version 2.0"). diff --git a/include/emqx_mqtt.hrl b/include/emqx_mqtt.hrl index 3021e913a..7e7670112 100644 --- a/include/emqx_mqtt.hrl +++ b/include/emqx_mqtt.hrl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/include/logger.hrl b/include/logger.hrl index 6a94d6bc9..f828a1fb3 100644 --- a/include/logger.hrl +++ b/include/logger.hrl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx.erl b/src/emqx.erl index 728b35cfc..d326f804a 100644 --- a/src/emqx.erl +++ b/src/emqx.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_access_control.erl b/src/emqx_access_control.erl index 1c43eb746..8b38889e7 100644 --- a/src/emqx_access_control.erl +++ b/src/emqx_access_control.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_access_rule.erl b/src/emqx_access_rule.erl index 72a3d09b2..27a6ab821 100644 --- a/src/emqx_access_rule.erl +++ b/src/emqx_access_rule.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_acl_cache.erl b/src/emqx_acl_cache.erl index 5be92814d..fb63e0ad5 100644 --- a/src/emqx_acl_cache.erl +++ b/src/emqx_acl_cache.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_acl_internal.erl b/src/emqx_acl_internal.erl index 1effd1709..6d5b9885e 100644 --- a/src/emqx_acl_internal.erl +++ b/src/emqx_acl_internal.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_acl_mod.erl b/src/emqx_acl_mod.erl index 716b27967..c75532441 100644 --- a/src/emqx_acl_mod.erl +++ b/src/emqx_acl_mod.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_alarm_mgr.erl b/src/emqx_alarm_mgr.erl index 6573904d6..cfb99678e 100644 --- a/src/emqx_alarm_mgr.erl +++ b/src/emqx_alarm_mgr.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_app.erl b/src/emqx_app.erl index 977eabc2f..30483dbde 100644 --- a/src/emqx_app.erl +++ b/src/emqx_app.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_auth_mod.erl b/src/emqx_auth_mod.erl index 00ecb659a..615b4e528 100644 --- a/src/emqx_auth_mod.erl +++ b/src/emqx_auth_mod.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_banned.erl b/src/emqx_banned.erl index 9da05cd15..d121627b9 100644 --- a/src/emqx_banned.erl +++ b/src/emqx_banned.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_base62.erl b/src/emqx_base62.erl index 1a9db245a..79c19a508 100644 --- a/src/emqx_base62.erl +++ b/src/emqx_base62.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_batch.erl b/src/emqx_batch.erl index ffa9a7224..f2592dd93 100644 --- a/src/emqx_batch.erl +++ b/src/emqx_batch.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_bridge.erl b/src/emqx_bridge.erl index 5d3ae3e91..acfe844f1 100644 --- a/src/emqx_bridge.erl +++ b/src/emqx_bridge.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_bridge_sup.erl b/src/emqx_bridge_sup.erl index 3911da2a6..baa857074 100644 --- a/src/emqx_bridge_sup.erl +++ b/src/emqx_bridge_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_broker.erl b/src/emqx_broker.erl index a8da25ce6..5bca1efe8 100644 --- a/src/emqx_broker.erl +++ b/src/emqx_broker.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_broker_helper.erl b/src/emqx_broker_helper.erl index d7eb6bfa2..573ee30df 100644 --- a/src/emqx_broker_helper.erl +++ b/src/emqx_broker_helper.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_broker_sup.erl b/src/emqx_broker_sup.erl index 5b1c0a0e7..05154f393 100644 --- a/src/emqx_broker_sup.erl +++ b/src/emqx_broker_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_cli.erl b/src/emqx_cli.erl index f7d513e9d..37b2f17fb 100644 --- a/src/emqx_cli.erl +++ b/src/emqx_cli.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_client.erl b/src/emqx_client.erl index 1f8c2a22e..9e1222f11 100644 --- a/src/emqx_client.erl +++ b/src/emqx_client.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_client_sock.erl b/src/emqx_client_sock.erl index 505454e2d..e71eef169 100644 --- a/src/emqx_client_sock.erl +++ b/src/emqx_client_sock.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_cm.erl b/src/emqx_cm.erl index 1d5ae0c58..f8d986008 100644 --- a/src/emqx_cm.erl +++ b/src/emqx_cm.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_cm_sup.erl b/src/emqx_cm_sup.erl index e8c99c16b..6b0a8fb15 100644 --- a/src/emqx_cm_sup.erl +++ b/src/emqx_cm_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_config.erl b/src/emqx_config.erl index bab3eab56..5be039cf1 100644 --- a/src/emqx_config.erl +++ b/src/emqx_config.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_connection.erl b/src/emqx_connection.erl index 8859a7152..da75d211e 100644 --- a/src/emqx_connection.erl +++ b/src/emqx_connection.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_ctl.erl b/src/emqx_ctl.erl index 13cfab945..df7c1d1c9 100644 --- a/src/emqx_ctl.erl +++ b/src/emqx_ctl.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_flapping.erl b/src/emqx_flapping.erl index c1cefd893..c3d0d8abd 100644 --- a/src/emqx_flapping.erl +++ b/src/emqx_flapping.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_frame.erl b/src/emqx_frame.erl index 075f0a11e..4d958a036 100644 --- a/src/emqx_frame.erl +++ b/src/emqx_frame.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_gc.erl b/src/emqx_gc.erl index d608954a0..0d2334d71 100644 --- a/src/emqx_gc.erl +++ b/src/emqx_gc.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_gen_mod.erl b/src/emqx_gen_mod.erl index 42466fdd9..dc9304f98 100644 --- a/src/emqx_gen_mod.erl +++ b/src/emqx_gen_mod.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_guid.erl b/src/emqx_guid.erl index fa9139ebd..57baebaaf 100644 --- a/src/emqx_guid.erl +++ b/src/emqx_guid.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_hooks.erl b/src/emqx_hooks.erl index a2e08a439..de2f9e98a 100644 --- a/src/emqx_hooks.erl +++ b/src/emqx_hooks.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_inflight.erl b/src/emqx_inflight.erl index 876052974..da80e0b30 100644 --- a/src/emqx_inflight.erl +++ b/src/emqx_inflight.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_json.erl b/src/emqx_json.erl index 9c0740b33..76eeab0be 100644 --- a/src/emqx_json.erl +++ b/src/emqx_json.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_keepalive.erl b/src/emqx_keepalive.erl index 25740b099..2d9b0513f 100644 --- a/src/emqx_keepalive.erl +++ b/src/emqx_keepalive.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_kernel_sup.erl b/src/emqx_kernel_sup.erl index 6289437ac..bd98ccbdf 100644 --- a/src/emqx_kernel_sup.erl +++ b/src/emqx_kernel_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_listeners.erl b/src/emqx_listeners.erl index 6987f03f9..2a7375a7f 100644 --- a/src/emqx_listeners.erl +++ b/src/emqx_listeners.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_local_bridge.erl b/src/emqx_local_bridge.erl index df2dda686..0521e6d3f 100644 --- a/src/emqx_local_bridge.erl +++ b/src/emqx_local_bridge.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_local_bridge_sup.erl b/src/emqx_local_bridge_sup.erl index fed9f28a7..db349b94d 100644 --- a/src/emqx_local_bridge_sup.erl +++ b/src/emqx_local_bridge_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_local_bridge_sup_sup.erl b/src/emqx_local_bridge_sup_sup.erl index 0483552b2..8a61d5936 100644 --- a/src/emqx_local_bridge_sup_sup.erl +++ b/src/emqx_local_bridge_sup_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_logger.erl b/src/emqx_logger.erl index 72ba9d8d1..9d215affa 100644 --- a/src/emqx_logger.erl +++ b/src/emqx_logger.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -134,4 +134,4 @@ set_all_log_handlers_level([], _NewLevel, _NewHanlder) -> rollback([{ID, Level} | List]) -> emqx_logger:set_log_handler_level(ID, Level), rollback(List); -rollback([]) -> ok. \ No newline at end of file +rollback([]) -> ok. diff --git a/src/emqx_logger_formatter.erl b/src/emqx_logger_formatter.erl index 3c5d9fc16..034eb8d36 100644 --- a/src/emqx_logger_formatter.erl +++ b/src/emqx_logger_formatter.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2017-2018. All Rights Reserved. +%% Copyright Ericsson AB 2017-2013-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_message.erl b/src/emqx_message.erl index 9763d4c62..7e5388778 100644 --- a/src/emqx_message.erl +++ b/src/emqx_message.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_metrics.erl b/src/emqx_metrics.erl index 5453f6ad3..7cd62e8ee 100644 --- a/src/emqx_metrics.erl +++ b/src/emqx_metrics.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_misc.erl b/src/emqx_misc.erl index 38bc1c2b0..c8f5449b8 100644 --- a/src/emqx_misc.erl +++ b/src/emqx_misc.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mod_presence.erl b/src/emqx_mod_presence.erl index 59c675f9a..090a846cd 100644 --- a/src/emqx_mod_presence.erl +++ b/src/emqx_mod_presence.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mod_rewrite.erl b/src/emqx_mod_rewrite.erl index 25faef166..b07694c56 100644 --- a/src/emqx_mod_rewrite.erl +++ b/src/emqx_mod_rewrite.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mod_subscription.erl b/src/emqx_mod_subscription.erl index aed7f5af2..bba4e2ebf 100644 --- a/src/emqx_mod_subscription.erl +++ b/src/emqx_mod_subscription.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mod_sup.erl b/src/emqx_mod_sup.erl index ca5a3d61c..1361854ea 100644 --- a/src/emqx_mod_sup.erl +++ b/src/emqx_mod_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_modules.erl b/src/emqx_modules.erl index 60c4b6351..6f27256d0 100644 --- a/src/emqx_modules.erl +++ b/src/emqx_modules.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mountpoint.erl b/src/emqx_mountpoint.erl index f2046d5ee..544b986c1 100644 --- a/src/emqx_mountpoint.erl +++ b/src/emqx_mountpoint.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mqtt_caps.erl b/src/emqx_mqtt_caps.erl index 5f919d9c0..8a3211ec0 100644 --- a/src/emqx_mqtt_caps.erl +++ b/src/emqx_mqtt_caps.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mqtt_props.erl b/src/emqx_mqtt_props.erl index f4374d0d0..71767537b 100644 --- a/src/emqx_mqtt_props.erl +++ b/src/emqx_mqtt_props.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mqtt_types.erl b/src/emqx_mqtt_types.erl index 71451cca7..cb797e36a 100644 --- a/src/emqx_mqtt_types.erl +++ b/src/emqx_mqtt_types.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_mqueue.erl b/src/emqx_mqueue.erl index 48b0fa439..f4af00850 100644 --- a/src/emqx_mqueue.erl +++ b/src/emqx_mqueue.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_packet.erl b/src/emqx_packet.erl index e9c2fa0df..0224c239a 100644 --- a/src/emqx_packet.erl +++ b/src/emqx_packet.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_pd.erl b/src/emqx_pd.erl index ce1e7723c..4a0a65773 100644 --- a/src/emqx_pd.erl +++ b/src/emqx_pd.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_plugins.erl b/src/emqx_plugins.erl index ea3190a35..8a958db5a 100644 --- a/src/emqx_plugins.erl +++ b/src/emqx_plugins.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_pmon.erl b/src/emqx_pmon.erl index a00212ed5..a16154dce 100644 --- a/src/emqx_pmon.erl +++ b/src/emqx_pmon.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_pool.erl b/src/emqx_pool.erl index e90cdda6b..e28eafc1b 100644 --- a/src/emqx_pool.erl +++ b/src/emqx_pool.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_pool_sup.erl b/src/emqx_pool_sup.erl index 58a6a08cd..aebf48c20 100644 --- a/src/emqx_pool_sup.erl +++ b/src/emqx_pool_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_protocol.erl b/src/emqx_protocol.erl index 9b9ef7f7d..fad3c6f1a 100644 --- a/src/emqx_protocol.erl +++ b/src/emqx_protocol.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_rate_limiter.erl b/src/emqx_rate_limiter.erl index c8145dbbc..c01af7eda 100644 --- a/src/emqx_rate_limiter.erl +++ b/src/emqx_rate_limiter.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_reason_codes.erl b/src/emqx_reason_codes.erl index 5b7f7e42f..6797da59d 100644 --- a/src/emqx_reason_codes.erl +++ b/src/emqx_reason_codes.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_router.erl b/src/emqx_router.erl index 6989d90a6..510b4ae37 100644 --- a/src/emqx_router.erl +++ b/src/emqx_router.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_router_helper.erl b/src/emqx_router_helper.erl index 9eaa501d2..84a6c7637 100644 --- a/src/emqx_router_helper.erl +++ b/src/emqx_router_helper.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_router_sup.erl b/src/emqx_router_sup.erl index 945d7910f..486d44b69 100644 --- a/src/emqx_router_sup.erl +++ b/src/emqx_router_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_rpc.erl b/src/emqx_rpc.erl index d4433bf6c..0245da838 100644 --- a/src/emqx_rpc.erl +++ b/src/emqx_rpc.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sequence.erl b/src/emqx_sequence.erl index 33bb5edda..4c25108ea 100644 --- a/src/emqx_sequence.erl +++ b/src/emqx_sequence.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_session.erl b/src/emqx_session.erl index 689d84b29..289fe1ce5 100644 --- a/src/emqx_session.erl +++ b/src/emqx_session.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_session_sup.erl b/src/emqx_session_sup.erl index aa430ced9..576193800 100644 --- a/src/emqx_session_sup.erl +++ b/src/emqx_session_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index e14963bc7..51884efa9 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sm.erl b/src/emqx_sm.erl index dcbe9028e..93eb827a4 100644 --- a/src/emqx_sm.erl +++ b/src/emqx_sm.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sm_locker.erl b/src/emqx_sm_locker.erl index 409331b88..bdb53038a 100644 --- a/src/emqx_sm_locker.erl +++ b/src/emqx_sm_locker.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sm_registry.erl b/src/emqx_sm_registry.erl index 327be77c1..535ca4a64 100644 --- a/src/emqx_sm_registry.erl +++ b/src/emqx_sm_registry.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sm_sup.erl b/src/emqx_sm_sup.erl index ed491c67f..65702b26f 100644 --- a/src/emqx_sm_sup.erl +++ b/src/emqx_sm_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_stats.erl b/src/emqx_stats.erl index d86886c28..2e9c06759 100644 --- a/src/emqx_stats.erl +++ b/src/emqx_stats.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sup.erl b/src/emqx_sup.erl index 60be4db87..5f62df904 100644 --- a/src/emqx_sup.erl +++ b/src/emqx_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sys.erl b/src/emqx_sys.erl index d2fc3f546..ae80ae60e 100644 --- a/src/emqx_sys.erl +++ b/src/emqx_sys.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sys_mon.erl b/src/emqx_sys_mon.erl index 0a36cae65..1acbca98a 100644 --- a/src/emqx_sys_mon.erl +++ b/src/emqx_sys_mon.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_sys_sup.erl b/src/emqx_sys_sup.erl index b450ddd66..24609acdb 100644 --- a/src/emqx_sys_sup.erl +++ b/src/emqx_sys_sup.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_tables.erl b/src/emqx_tables.erl index fdb106a99..837a9d3e9 100644 --- a/src/emqx_tables.erl +++ b/src/emqx_tables.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_time.erl b/src/emqx_time.erl index a7edf7efb..60787fa37 100644 --- a/src/emqx_time.erl +++ b/src/emqx_time.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_topic.erl b/src/emqx_topic.erl index f7e229a13..2a37a873d 100644 --- a/src/emqx_topic.erl +++ b/src/emqx_topic.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_tracer.erl b/src/emqx_tracer.erl index d92cb4a1f..e88442f61 100644 --- a/src/emqx_tracer.erl +++ b/src/emqx_tracer.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -151,4 +151,4 @@ filter_by_meta_key(#{meta:=Meta}=LogEvent, {MetaKey, MetaValue}) -> false -> ignore end; _ -> ignore - end. \ No newline at end of file + end. diff --git a/src/emqx_trie.erl b/src/emqx_trie.erl index a892b1fc2..9b9436ce0 100644 --- a/src/emqx_trie.erl +++ b/src/emqx_trie.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_types.erl b/src/emqx_types.erl index 960aa699a..dcbcb8f5b 100644 --- a/src/emqx_types.erl +++ b/src/emqx_types.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_vm.erl b/src/emqx_vm.erl index 15ae00689..85019d8c5 100644 --- a/src/emqx_vm.erl +++ b/src/emqx_vm.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_ws_connection.erl b/src/emqx_ws_connection.erl index 69a3849fe..426677ff5 100644 --- a/src/emqx_ws_connection.erl +++ b/src/emqx_ws_connection.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqx_zone.erl b/src/emqx_zone.erl index 890d14a89..9a1ad7e69 100644 --- a/src/emqx_zone.erl +++ b/src/emqx_zone.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_SUITE.erl b/test/emqx_SUITE.erl index c6bea732a..1c591b404 100644 --- a/test/emqx_SUITE.erl +++ b/test/emqx_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_access_SUITE.erl b/test/emqx_access_SUITE.erl index b49c90d80..60f709ee5 100644 --- a/test/emqx_access_SUITE.erl +++ b/test/emqx_access_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_acl_test_mod.erl b/test/emqx_acl_test_mod.erl index 131336cdd..343202a96 100644 --- a/test/emqx_acl_test_mod.erl +++ b/test/emqx_acl_test_mod.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_auth_anonymous_test_mod.erl b/test/emqx_auth_anonymous_test_mod.erl index e04841feb..60ee4ad5f 100644 --- a/test/emqx_auth_anonymous_test_mod.erl +++ b/test/emqx_auth_anonymous_test_mod.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_auth_dashboard.erl b/test/emqx_auth_dashboard.erl index b8c742d3b..00c8bdec5 100644 --- a/test/emqx_auth_dashboard.erl +++ b/test/emqx_auth_dashboard.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_banned_SUITE.erl b/test/emqx_banned_SUITE.erl index 7e7434e61..bf7c9908a 100644 --- a/test/emqx_banned_SUITE.erl +++ b/test/emqx_banned_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_batch_SUITE.erl b/test/emqx_batch_SUITE.erl index c4c69080b..277459cfe 100644 --- a/test/emqx_batch_SUITE.erl +++ b/test/emqx_batch_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_bridge_SUITE.erl b/test/emqx_bridge_SUITE.erl index bd2894101..9681c27e6 100644 --- a/test/emqx_bridge_SUITE.erl +++ b/test/emqx_bridge_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_broker_SUITE.erl b/test/emqx_broker_SUITE.erl index b2031a61c..81796dbdc 100644 --- a/test/emqx_broker_SUITE.erl +++ b/test/emqx_broker_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_client_SUITE.erl b/test/emqx_client_SUITE.erl index 13303bfdc..7b86f851c 100644 --- a/test/emqx_client_SUITE.erl +++ b/test/emqx_client_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_cm_SUITE.erl b/test/emqx_cm_SUITE.erl index 3d879a476..a64c8139a 100644 --- a/test/emqx_cm_SUITE.erl +++ b/test/emqx_cm_SUITE.erl @@ -1,5 +1,5 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_connection_SUITE.erl b/test/emqx_connection_SUITE.erl index 769f8df1f..aca650215 100644 --- a/test/emqx_connection_SUITE.erl +++ b/test/emqx_connection_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_ct_broker_helpers.erl b/test/emqx_ct_broker_helpers.erl index c1433c203..7ea2daaeb 100644 --- a/test/emqx_ct_broker_helpers.erl +++ b/test/emqx_ct_broker_helpers.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -148,4 +148,4 @@ flush(Msgs) -> M -> flush([M|Msgs]) after 0 -> lists:reverse(Msgs) - end. \ No newline at end of file + end. diff --git a/test/emqx_ct_helpers.erl b/test/emqx_ct_helpers.erl index c61c5be6e..eae22d6ab 100644 --- a/test/emqx_ct_helpers.erl +++ b/test/emqx_ct_helpers.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_frame_SUITE.erl b/test/emqx_frame_SUITE.erl index a4e64c7d0..86505a566 100644 --- a/test/emqx_frame_SUITE.erl +++ b/test/emqx_frame_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_gc_SUITE.erl b/test/emqx_gc_SUITE.erl index 22d7cd584..e75cb2320 100644 --- a/test/emqx_gc_SUITE.erl +++ b/test/emqx_gc_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_guid_SUITE.erl b/test/emqx_guid_SUITE.erl index cb2e6543c..f412138ad 100644 --- a/test/emqx_guid_SUITE.erl +++ b/test/emqx_guid_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_hooks_SUITE.erl b/test/emqx_hooks_SUITE.erl index 1961d0e02..864a3ab96 100644 --- a/test/emqx_hooks_SUITE.erl +++ b/test/emqx_hooks_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_inflight_SUITE.erl b/test/emqx_inflight_SUITE.erl index 5e504f4f8..d0373e11b 100644 --- a/test/emqx_inflight_SUITE.erl +++ b/test/emqx_inflight_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_json_SUITE.erl b/test/emqx_json_SUITE.erl index 980d29703..ccdce1cd2 100644 --- a/test/emqx_json_SUITE.erl +++ b/test/emqx_json_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_keepalive_SUITE.erl b/test/emqx_keepalive_SUITE.erl index c4dbd80f2..a60383b01 100644 --- a/test/emqx_keepalive_SUITE.erl +++ b/test/emqx_keepalive_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_lib_SUITE.erl b/test/emqx_lib_SUITE.erl index 12bbd023e..1d7e1f31f 100644 --- a/test/emqx_lib_SUITE.erl +++ b/test/emqx_lib_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_listeners_SUITE.erl b/test/emqx_listeners_SUITE.erl index 17181aa31..d969699bc 100644 --- a/test/emqx_listeners_SUITE.erl +++ b/test/emqx_listeners_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_message_SUITE.erl b/test/emqx_message_SUITE.erl index 3bb06d14c..9bf862af3 100644 --- a/test/emqx_message_SUITE.erl +++ b/test/emqx_message_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_metrics_SUITE.erl b/test/emqx_metrics_SUITE.erl index ead7e98ba..ff9dee8c1 100644 --- a/test/emqx_metrics_SUITE.erl +++ b/test/emqx_metrics_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_misc_tests.erl b/test/emqx_misc_tests.erl index 92b0973e8..d0da45fba 100644 --- a/test/emqx_misc_tests.erl +++ b/test/emqx_misc_tests.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mock_client.erl b/test/emqx_mock_client.erl index 36d743ef9..7de80ad4a 100644 --- a/test/emqx_mock_client.erl +++ b/test/emqx_mock_client.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mod_SUITE.erl b/test/emqx_mod_SUITE.erl index 44376f7b7..39d9abc21 100644 --- a/test/emqx_mod_SUITE.erl +++ b/test/emqx_mod_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mod_rewrite_tests.erl b/test/emqx_mod_rewrite_tests.erl index 6fea7ee71..bc41977c3 100644 --- a/test/emqx_mod_rewrite_tests.erl +++ b/test/emqx_mod_rewrite_tests.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mod_sup_SUITE.erl b/test/emqx_mod_sup_SUITE.erl index 29b59d0b8..85fa6af78 100644 --- a/test/emqx_mod_sup_SUITE.erl +++ b/test/emqx_mod_sup_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mountpoint_SUITE.erl b/test/emqx_mountpoint_SUITE.erl index a77baf751..8db5805b0 100644 --- a/test/emqx_mountpoint_SUITE.erl +++ b/test/emqx_mountpoint_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mqtt_caps_SUITE.erl b/test/emqx_mqtt_caps_SUITE.erl index 26e343ca6..e07158e72 100644 --- a/test/emqx_mqtt_caps_SUITE.erl +++ b/test/emqx_mqtt_caps_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mqtt_packet_SUITE.erl b/test/emqx_mqtt_packet_SUITE.erl index 4386ff02e..3be2617b0 100644 --- a/test/emqx_mqtt_packet_SUITE.erl +++ b/test/emqx_mqtt_packet_SUITE.erl @@ -1,5 +1,5 @@ %%%=================================================================== -%%% Copyright (c) 2013-2018 EMQ Inc. All rights reserved. +%%% Copyright (c) 2013-2013-2019 EMQ Inc. All rights reserved. %%% %%% Licensed under the Apache License, Version 2.0 (the "License"); %%% you may not use this file except in compliance with the License. diff --git a/test/emqx_mqtt_props_SUITE.erl b/test/emqx_mqtt_props_SUITE.erl index 8d3b16a14..09a2611f7 100644 --- a/test/emqx_mqtt_props_SUITE.erl +++ b/test/emqx_mqtt_props_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_mqueue_SUITE.erl b/test/emqx_mqueue_SUITE.erl index 9bb424fa1..8a97ec108 100644 --- a/test/emqx_mqueue_SUITE.erl +++ b/test/emqx_mqueue_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_net_SUITE.erl b/test/emqx_net_SUITE.erl index 50a830d10..47695043b 100644 --- a/test/emqx_net_SUITE.erl +++ b/test/emqx_net_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_packet_SUITE.erl b/test/emqx_packet_SUITE.erl index 7758da86e..4cb87bd18 100644 --- a/test/emqx_packet_SUITE.erl +++ b/test/emqx_packet_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_pd_SUITE.erl b/test/emqx_pd_SUITE.erl index e53fa7539..80b203392 100644 --- a/test/emqx_pd_SUITE.erl +++ b/test/emqx_pd_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_pmon_SUITE.erl b/test/emqx_pmon_SUITE.erl index 67e8cf4d7..6b2170282 100644 --- a/test/emqx_pmon_SUITE.erl +++ b/test/emqx_pmon_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_pool_SUITE.erl b/test/emqx_pool_SUITE.erl index 72fe51ec0..ea648709f 100644 --- a/test/emqx_pool_SUITE.erl +++ b/test/emqx_pool_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_pqueue_SUITE.erl b/test/emqx_pqueue_SUITE.erl index 9efccf472..31d3fefd3 100644 --- a/test/emqx_pqueue_SUITE.erl +++ b/test/emqx_pqueue_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_protocol_SUITE.erl b/test/emqx_protocol_SUITE.erl index fc96cc839..e48825d76 100644 --- a/test/emqx_protocol_SUITE.erl +++ b/test/emqx_protocol_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2013-2018 EMQ Enterprise, Inc. (http://emqtt.io) +%% Copyright (c) 2013-2013-2019 EMQ Enterprise, Inc. (http://emqtt.io) %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_protocol_tests.erl b/test/emqx_protocol_tests.erl index 56b65e36a..acadfe79d 100644 --- a/test/emqx_protocol_tests.erl +++ b/test/emqx_protocol_tests.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_reason_codes_tests.erl b/test/emqx_reason_codes_tests.erl index a8e352c83..bf38a451e 100644 --- a/test/emqx_reason_codes_tests.erl +++ b/test/emqx_reason_codes_tests.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License") %% you may not use this file except in compliance with the License. diff --git a/test/emqx_router_SUITE.erl b/test/emqx_router_SUITE.erl index 9174c258a..3a1b77e27 100644 --- a/test/emqx_router_SUITE.erl +++ b/test/emqx_router_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_sequence_SUITE.erl b/test/emqx_sequence_SUITE.erl index ab408b8e0..7b95c0c67 100644 --- a/test/emqx_sequence_SUITE.erl +++ b/test/emqx_sequence_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_session_SUITE.erl b/test/emqx_session_SUITE.erl index b8e0aedd3..54b2e8579 100644 --- a/test/emqx_session_SUITE.erl +++ b/test/emqx_session_SUITE.erl @@ -1,5 +1,5 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_shared_sub_SUITE.erl b/test/emqx_shared_sub_SUITE.erl index cc5a5f515..1ee059812 100644 --- a/test/emqx_shared_sub_SUITE.erl +++ b/test/emqx_shared_sub_SUITE.erl @@ -1,5 +1,5 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_sm_SUITE.erl b/test/emqx_sm_SUITE.erl index 3d1db5ddc..2985bc823 100644 --- a/test/emqx_sm_SUITE.erl +++ b/test/emqx_sm_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_stats_tests.erl b/test/emqx_stats_tests.erl index e8b5e82af..7170c422b 100644 --- a/test/emqx_stats_tests.erl +++ b/test/emqx_stats_tests.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_sys_mon_SUITE.erl b/test/emqx_sys_mon_SUITE.erl index e2e9fe2ad..53b6cebfd 100644 --- a/test/emqx_sys_mon_SUITE.erl +++ b/test/emqx_sys_mon_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_tables_SUITE.erl b/test/emqx_tables_SUITE.erl index 1002c0a0b..c282e93af 100644 --- a/test/emqx_tables_SUITE.erl +++ b/test/emqx_tables_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_time_SUITE.erl b/test/emqx_time_SUITE.erl index 470b9dfe7..4c8886f9c 100644 --- a/test/emqx_time_SUITE.erl +++ b/test/emqx_time_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_topic_SUITE.erl b/test/emqx_topic_SUITE.erl index 8ce3faf79..2ad57154d 100644 --- a/test/emqx_topic_SUITE.erl +++ b/test/emqx_topic_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_tracer_SUITE.erl b/test/emqx_tracer_SUITE.erl index d1a3bfa5e..323700823 100644 --- a/test/emqx_tracer_SUITE.erl +++ b/test/emqx_tracer_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -71,4 +71,4 @@ start_traces(_Config) -> ok = emqx_tracer:stop_trace({topic, <<"a/#">>}), emqx_client:disconnect(T), - emqx_logger:set_log_level(error). \ No newline at end of file + emqx_logger:set_log_level(error). diff --git a/test/emqx_trie_SUITE.erl b/test/emqx_trie_SUITE.erl index f10d13d0a..ad92cb313 100644 --- a/test/emqx_trie_SUITE.erl +++ b/test/emqx_trie_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_vm_SUITE.erl b/test/emqx_vm_SUITE.erl index 91744764e..650f792ab 100644 --- a/test/emqx_vm_SUITE.erl +++ b/test/emqx_vm_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_ws_connection_SUITE.erl b/test/emqx_ws_connection_SUITE.erl index dd7b17f3e..c3698861b 100644 --- a/test/emqx_ws_connection_SUITE.erl +++ b/test/emqx_ws_connection_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqx_zone_SUITE.erl b/test/emqx_zone_SUITE.erl index 83c2ceaab..23ef3c67d 100644 --- a/test/emqx_zone_SUITE.erl +++ b/test/emqx_zone_SUITE.erl @@ -1,4 +1,4 @@ -%% Copyright (c) 2018 EMQ Technologies Co., Ltd. All Rights Reserved. +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. From 78ea56348c7de96fabdd6db27701a1b7265c5e8b Mon Sep 17 00:00:00 2001 From: turtleDeng Date: Tue, 29 Jan 2019 10:46:51 +0800 Subject: [PATCH 3/7] Update Copyright to 2019 (#2191) From 11d9aaa002f97e2c92ee498ce095f46443897d59 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 11 Feb 2019 15:41:29 +0800 Subject: [PATCH 4/7] Use the new site 'emqx.io' --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1d5a9780a..35ed465e8 100644 --- a/README.md +++ b/README.md @@ -6,17 +6,17 @@ Starting from 3.0 release, *EMQ X* broker fully supports MQTT V5.0 protocol spec - For full list of new features, please read *EMQ X* broker 3.0 [release notes](https://github.com/emqx/emqx/releases/). -- For more information, please visit [EMQ X homepage](http://emqtt.io). +- For more information, please visit [EMQ X homepage](http://emqx.io). ## Installation The *EMQ X* broker is cross-platform, which can be deployed on Linux, Unix, Mac, Windows and even Raspberry Pi. -Download the binary package for your platform from [here](http://emqtt.io/downloads). +Download the binary package for your platform from [here](http://emqx.io/downloads). -- [Single Node Install](http://emqtt.io/docs/v3/install.html) -- [Multi Node Install](http://emqtt.io/docs/v3/cluster.html) +- [Single Node Install](https://developer.emqx.io/docs/emq/v3/en/install.html) +- [Multi Node Install](https://developer.emqx.io/docs/emq/v3/en/cluster.html) ## Build From Source @@ -75,7 +75,7 @@ You can read the mqtt protocol via the following links: ## License -Copyright (c) 2013-2019 [EMQ Technologies Co., Ltd](http://emqtt.io). All Rights Reserved. +Copyright (c) 2013-2019 [EMQ Technologies Co., Ltd](http://emqx.io). All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at From 44d3eff094ac123fb9420707abfae07b827d0dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A5=87=E6=80=AA?= Date: Tue, 19 Feb 2019 14:00:34 +0800 Subject: [PATCH 5/7] Auto-pull-request-by-2019-02-19 (#2232) * Update Copyright to 2019 (#2191) * Disable bridges by default (#2189) * Fix warning logger args emqx#2195 * Ambiguity elimination (#2217) * Fix emqx_ws_connection: prevent crashes on pong (#2210) * Issue#2184 (#2194) * Delete dep-vsn-check * Format app.src --- Makefile | 23 ------------- etc/emqx.conf | 58 ++++++++++++++++----------------- include/logger.hrl | 2 +- priv/emqx.schema | 14 ++++---- rebar.config.script | 1 - src/emqx.app.src | 3 +- src/emqx_ws_connection.erl | 10 +++++- test/emqx_ct_broker_helpers.erl | 28 ++++++++++++++++ 8 files changed, 76 insertions(+), 63 deletions(-) diff --git a/Makefile b/Makefile index 16c9795b1..0d9bfb7c4 100644 --- a/Makefile +++ b/Makefile @@ -113,26 +113,3 @@ rebar-clean: distclean:: @rm -rf _build cover deps logs log data @rm -f rebar.lock compile_commands.json cuttlefish - -## Below are for version consistency check during erlang.mk and rebar3 dual mode support -none= -space = $(none) $(none) -comma = , -quote = \" -curly_l = "{" -curly_r = "}" -dep-versions = [$(foreach dep,$(DEPS) $(BUILD_DEPS),$(curly_l)$(dep),$(quote)$(word $(words $(dep_$(dep))),$(dep_$(dep)))$(quote)$(curly_r)$(comma))[]] - -.PHONY: dep-vsn-check -dep-vsn-check: - $(verbose) erl -noshell -eval \ - "MkVsns = lists:sort(lists:flatten($(dep-versions))), \ - {ok, Conf} = file:consult('rebar.config'), \ - {_, Deps1} = lists:keyfind(deps, 1, Conf), \ - {_, Deps2} = lists:keyfind(github_emqx_deps, 1, Conf), \ - F = fun({N, V}) when is_list(V) -> {N, V}; ({N, {git, _, {branch, V}}}) -> {N, V} end, \ - RebarVsns = lists:sort(lists:map(F, Deps1 ++ Deps2)), \ - case {RebarVsns -- MkVsns, MkVsns -- RebarVsns} of \ - {[], []} -> halt(0); \ - {Rebar, Mk} -> erlang:error({deps_version_discrepancy, [{rebar, Rebar}, {mk, Mk}]}) \ - end." diff --git a/etc/emqx.conf b/etc/emqx.conf index fc37427e6..d762aef7e 100644 --- a/etc/emqx.conf +++ b/etc/emqx.conf @@ -286,32 +286,32 @@ rpc.tcp_client_port = 5369 ## RCP Client connect timeout. ## ## Value: Seconds -rpc.connect_timeout = 5000 +rpc.connect_timeout = 5s ## TCP send timeout of RPC client and server. ## ## Value: Seconds -rpc.send_timeout = 5000 +rpc.send_timeout = 5s ## Authentication timeout ## ## Value: Seconds -rpc.authentication_timeout = 5000 +rpc.authentication_timeout = 5s ## Default receive timeout for call() functions ## ## Value: Seconds -rpc.call_receive_timeout = 15000 +rpc.call_receive_timeout = 15s ## Socket idle keepalive. ## ## Value: Seconds -rpc.socket_keepalive_idle = 900 +rpc.socket_keepalive_idle = 900s ## TCP Keepalive probes interval. ## -## Value: Integer -rpc.socket_keepalive_interval = 75 +## Value: Seconds +rpc.socket_keepalive_interval = 75s ## Probes lost to close the connection ## @@ -947,7 +947,7 @@ listener.tcp.internal.send_timeout = 5s ## See: listener.tcp.$name.send_timeout_close ## ## Value: on | off -listener.tcp.external.send_timeout_close = on +listener.tcp.internal.send_timeout_close = on ## The TCP receive buffer(os kernel) for internal MQTT connections. ## @@ -1596,29 +1596,29 @@ listener.wss.external.ciphers = ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-G ## Value: enum ## manual ## auto -bridge.aws.start_type = manual +## bridge.aws.start_type = manual ## Bridge reconnect time. ## ## Value: Duration ## Default: 30 seconds -bridge.aws.reconnect_interval = 30s +## bridge.aws.reconnect_interval = 30s ## Retry interval for bridge QoS1 message delivering. ## ## Value: Duration -bridge.aws.retry_interval = 20s +## bridge.aws.retry_interval = 20s ## Inflight size. ## ## Value: Integer -bridge.aws.max_inflight = 32 +## bridge.aws.max_inflight = 32 ## Bridge address: node name for local bridge, host:port for remote. ## ## Value: String ## Example: emqx@127.0.0.1, 127.0.0.1:1883 -bridge.aws.address = 127.0.0.1:1883 +## bridge.aws.address = 127.0.0.1:1883 ## Protocol version of the bridge. ## @@ -1626,12 +1626,12 @@ bridge.aws.address = 127.0.0.1:1883 ## - mqttv5 ## - mqttv4 ## - mqttv3 -bridge.aws.proto_ver = mqttv4 +## bridge.aws.proto_ver = mqttv4 ## The ClientId of a remote bridge. ## ## Value: String -bridge.aws.client_id = bridge_aws +## bridge.aws.client_id = bridge_aws ## The Clean start flag of a remote bridge. ## @@ -1645,62 +1645,62 @@ bridge.aws.client_id = bridge_aws ## The username for a remote bridge. ## ## Value: String -bridge.aws.username = user +## bridge.aws.username = user ## The password for a remote bridge. ## ## Value: String -bridge.aws.password = passwd +## bridge.aws.password = passwd ## Mountpoint of the bridge. ## ## Value: String -bridge.aws.mountpoint = bridge/aws/${node}/ +## bridge.aws.mountpoint = bridge/aws/${node}/ ## Ping interval of a down bridge. ## ## Value: Duration ## Default: 10 seconds -bridge.aws.keepalive = 60s +## bridge.aws.keepalive = 60s ## Forward message topics ## ## Value: String ## Example: topic1/#,topic2/# -bridge.aws.forwards = topic1/#,topic2/# +## bridge.aws.forwards = topic1/#,topic2/# ## Subscriptions of the bridge topic. ## ## Value: String -bridge.aws.subscription.1.topic = cmd/topic1 +## bridge.aws.subscription.1.topic = cmd/topic1 ## Subscriptions of the bridge qos. ## ## Value: Number -bridge.aws.subscription.1.qos = 1 +## bridge.aws.subscription.1.qos = 1 ## Subscriptions of the bridge topic. ## ## Value: String -bridge.aws.subscription.2.topic = cmd/topic2 +## bridge.aws.subscription.2.topic = cmd/topic2 ## Subscriptions of the bridge qos. ## ## Value: Number -bridge.aws.subscription.2.qos = 1 +## bridge.aws.subscription.2.qos = 1 ## If enabled, queue would be written into disk more quickly. ## However, If disabled, some message would be dropped in ## the situation emqx crashed. ## ## Value: on | off -bridge.aws.queue.mem_cache = on +## bridge.aws.queue.mem_cache = on ## Batch size for buffer queue stored ## ## Value: Integer ## default: 1000 -bridge.aws.queue.batch_size = 1000 +## bridge.aws.queue.batch_size = 1000 ## Base directory for replayq to store messages on disk ## If this config entry is missing or set to undefined, @@ -1709,18 +1709,18 @@ bridge.aws.queue.batch_size = 1000 ## this config entry would have no effect on mqueue ## ## Value: String -bridge.aws.queue.replayq_dir = {{ platform_data_dir }}/emqx_aws_bridge/ +## bridge.aws.queue.replayq_dir = {{ platform_data_dir }}/emqx_aws_bridge/ ## Replayq segment size ## ## Value: Bytesize -bridge.aws.queue.replayq_seg_bytes = 10MB +## bridge.aws.queue.replayq_seg_bytes = 10MB ## Bribge to remote server via SSL. ## ## Value: on | off -bridge.aws.ssl = off +## bridge.aws.ssl = off ## PEM-encoded CA certificates of the bridge. ## diff --git a/include/logger.hrl b/include/logger.hrl index f828a1fb3..a2ee404d9 100644 --- a/include/logger.hrl +++ b/include/logger.hrl @@ -24,7 +24,7 @@ -define(NOTICE(Format, Args), ?LOG(notice, Format, Args)). -define(WARN(Format), ?LOG(warning, Format, [])). --define(WARN(Format, Args), ?LOG(warning, Format, [])). +-define(WARN(Format, Args), ?LOG(warning, Format, Args)). -define(ERROR(Format), ?LOG(error, Format, [])). -define(ERROR(Format, Args), ?LOG(error, Format, Args)). diff --git a/priv/emqx.schema b/priv/emqx.schema index 1f8e4fa6b..2136bacad 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -324,38 +324,38 @@ end}. %% Client connect timeout {mapping, "rpc.connect_timeout", "gen_rpc.connect_timeout", [ - {default, 5000}, - {datatype, integer} + {default, "5s"}, + {datatype, {duration, ms}} ]}. %% Client and Server send timeout {mapping, "rpc.send_timeout", "gen_rpc.send_timeout", [ {default, 5000}, - {datatype, integer} + {datatype, {duration, ms}} ]}. %% Authentication timeout {mapping, "rpc.authentication_timeout", "gen_rpc.authentication_timeout", [ {default, 5000}, - {datatype, integer} + {datatype, {duration, ms}} ]}. %% Default receive timeout for call() functions {mapping, "rpc.call_receive_timeout", "gen_rpc.call_receive_timeout", [ {default, 15000}, - {datatype, integer} + {datatype, {duration, ms}} ]}. %% Socket keepalive configuration {mapping, "rpc.socket_keepalive_idle", "gen_rpc.socket_keepalive_idle", [ {default, 7200}, - {datatype, integer} + {datatype, {duration, s}} ]}. %% Seconds between probes {mapping, "rpc.socket_keepalive_interval", "gen_rpc.socket_keepalive_interval", [ {default, 75}, - {datatype, integer} + {datatype, {duration, s}} ]}. %% Probes lost to close the connection diff --git a/rebar.config.script b/rebar.config.script index aed271af8..2c04540dc 100644 --- a/rebar.config.script +++ b/rebar.config.script @@ -1,4 +1,3 @@ - CONFIG0 = case os:getenv("REBAR_GIT_CLONE_OPTIONS") of "--depth 1" -> CONFIG; diff --git a/src/emqx.app.src b/src/emqx.app.src index d4613a5af..f9c174ae3 100644 --- a/src/emqx.app.src +++ b/src/emqx.app.src @@ -3,7 +3,8 @@ {vsn,"git"}, {modules,[]}, {registered,[emqx_sup]}, - {applications,[kernel,stdlib,jsx,gproc,gen_rpc,esockd,cowboy,replayq]}, + {applications,[kernel,stdlib,jsx,gproc,gen_rpc,esockd,cowboy, + replayq]}, {env,[]}, {mod,{emqx_app,[]}}, {maintainers,["Feng Lee "]}, diff --git a/src/emqx_ws_connection.erl b/src/emqx_ws_connection.erl index 426677ff5..fec52995f 100644 --- a/src/emqx_ws_connection.erl +++ b/src/emqx_ws_connection.erl @@ -189,7 +189,15 @@ websocket_handle({binary, Data}, State = #state{parser_state = ParserState, _:Error -> ?LOG(error, "Frame error:~p~nFrame data: ~p", [Error, Data]), shutdown(parse_error, State) - end. + end; +%% Pings should be replied with pongs, cowboy does it automatically +%% Pongs can be safely ignored. Clause here simply prevents crash. +websocket_handle(Frame, State) + when Frame =:= ping; Frame =:= pong -> + {ok, ensure_stats_timer(State)}; +websocket_handle({FrameType, _}, State) + when FrameType =:= ping; FrameType =:= pong -> + {ok, ensure_stats_timer(State)}. websocket_info({call, From, info}, State) -> gen_server:reply(From, info(State)), diff --git a/test/emqx_ct_broker_helpers.erl b/test/emqx_ct_broker_helpers.erl index 7ea2daaeb..1ab79e8a9 100644 --- a/test/emqx_ct_broker_helpers.erl +++ b/test/emqx_ct_broker_helpers.erl @@ -56,6 +56,7 @@ run_setup_steps() -> NewConfig = generate_config(), lists:foreach(fun set_app_env/1, NewConfig), + set_bridge_env(), application:ensure_all_started(?APP). run_teardown_steps() -> @@ -88,6 +89,10 @@ set_app_env({App, Lists}) -> application:set_env(App, Par, Var) end, Lists). +set_bridge_env() -> + BridgeEnvs = bridge_conf(), + application:set_env(?APP, bridges, BridgeEnvs). + change_opts(SslType) -> {ok, Listeners} = application:get_env(?APP, listeners), NewListeners = @@ -149,3 +154,26 @@ flush(Msgs) -> after 0 -> lists:reverse(Msgs) end. + +bridge_conf() -> + [{aws, + [{username,"user"}, + {address,"127.0.0.1:1883"}, + {clean_start,true}, + {client_id,"bridge_aws"}, + {forwards,["topic1/#","topic2/#"]}, + {keepalive,60000}, + {max_inflight,32}, + {mountpoint,"bridge/aws/${node}/"}, + {password,"passwd"}, + {proto_ver,mqttv4}, + {queue, + #{batch_size => 1000,mem_cache => true, + replayq_dir => "data/emqx_aws_bridge/", + replayq_seg_bytes => 10485760}}, + {reconnect_interval,30000}, + {retry_interval,20000}, + {ssl,false}, + {ssl_opts,[{versions,[tlsv1,'tlsv1.1','tlsv1.2']}]}, + {start_type,manual}, + {subscriptions,[{"cmd/topic1",1},{"cmd/topic2",1}]}]}]. \ No newline at end of file From 7a645dd9cc10a73104f5190e22201144b564db7d Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 19 Feb 2019 11:07:44 +0800 Subject: [PATCH 6/7] Add 'include/types.hrl' and introduce some common types --- src/emqx.erl | 3 +++ src/emqx_banned.erl | 3 ++- src/emqx_broker.erl | 5 +++-- src/emqx_broker_helper.erl | 5 +++-- src/emqx_client.erl | 7 ++++--- src/emqx_cm.erl | 5 +++-- src/emqx_gc.erl | 6 ++++-- src/emqx_hooks.erl | 3 ++- src/emqx_metrics.erl | 3 ++- src/emqx_mqueue.erl | 3 ++- src/emqx_pd.erl | 4 +++- src/emqx_pool.erl | 3 ++- src/emqx_router.erl | 3 ++- src/emqx_router_helper.erl | 3 ++- src/emqx_session.erl | 13 +++++++------ src/emqx_session_sup.erl | 5 +++-- src/emqx_shared_sub.erl | 3 ++- src/emqx_sm.erl | 3 ++- src/emqx_sm_locker.erl | 5 +++-- src/emqx_sm_registry.erl | 3 ++- src/emqx_stats.erl | 7 ++++--- src/emqx_sys_mon.erl | 9 ++++++++- src/emqx_types.erl | 8 +++----- src/emqx_zone.erl | 7 ++++--- 24 files changed, 75 insertions(+), 44 deletions(-) diff --git a/src/emqx.erl b/src/emqx.erl index d326f804a..623bb3bd9 100644 --- a/src/emqx.erl +++ b/src/emqx.erl @@ -15,6 +15,7 @@ -module(emqx). -include("emqx.hrl"). +-include("types.hrl"). %% Start/Stop the application -export([start/0, restart/1, is_running/1, stop/0]). @@ -167,8 +168,10 @@ reboot() -> %%------------------------------------------------------------------------------ %% Internal functions %%------------------------------------------------------------------------------ + reload_config(ConfFile) -> {ok, [Conf]} = file:consult(ConfFile), lists:foreach(fun({App, Vals}) -> [application:set_env(App, Par, Val) || {Par, Val} <- Vals] end, Conf). + diff --git a/src/emqx_banned.erl b/src/emqx_banned.erl index d121627b9..a35365d4e 100644 --- a/src/emqx_banned.erl +++ b/src/emqx_banned.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). %% Mnesia bootstrap -export([mnesia/1]). @@ -50,7 +51,7 @@ mnesia(copy) -> ok = ekka_mnesia:copy_table(?TAB). %% @doc Start the banned server. --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). diff --git a/src/emqx_broker.erl b/src/emqx_broker.erl index 5bca1efe8..b43fa5cff 100644 --- a/src/emqx_broker.erl +++ b/src/emqx_broker.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/2]). -export([subscribe/1, subscribe/2, subscribe/3]). @@ -53,7 +54,7 @@ %% Guards -define(is_subid(Id), (is_binary(Id) orelse is_atom(Id))). --spec(start_link(atom(), pos_integer()) -> emqx_types:startlink_ret()). +-spec(start_link(atom(), pos_integer()) -> startlink_ret()). start_link(Pool, Id) -> ok = create_tabs(), gen_server:start_link({local, emqx_misc:proc_name(?BROKER, Id)}, @@ -322,7 +323,7 @@ subscribed(SubId, Topic) when ?is_subid(SubId) -> SubPid = emqx_broker_helper:lookup_subpid(SubId), ets:member(?SUBOPTION, {SubPid, Topic}). --spec(get_subopts(pid(), emqx_topic:topic()) -> emqx_types:subopts() | undefined). +-spec(get_subopts(pid(), emqx_topic:topic()) -> maybe(emqx_types:subopts())). get_subopts(SubPid, Topic) when is_pid(SubPid), is_binary(Topic) -> lookup_value(?SUBOPTION, {SubPid, Topic}); get_subopts(SubId, Topic) when ?is_subid(SubId) -> diff --git a/src/emqx_broker_helper.erl b/src/emqx_broker_helper.erl index 573ee30df..f5b880163 100644 --- a/src/emqx_broker_helper.erl +++ b/src/emqx_broker_helper.erl @@ -17,6 +17,7 @@ -behaviour(gen_server). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0]). -export([register_sub/2]). @@ -35,7 +36,7 @@ -define(BATCH_SIZE, 100000). --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?HELPER}, ?MODULE, [], []). @@ -50,7 +51,7 @@ register_sub(SubPid, SubId) when is_pid(SubPid) -> error(subid_conflict) end. --spec(lookup_subid(pid()) -> emqx_types:subid() | undefined). +-spec(lookup_subid(pid()) -> maybe(emqx_types:subid())). lookup_subid(SubPid) when is_pid(SubPid) -> emqx_tables:lookup_value(?SUBMON, SubPid). diff --git a/src/emqx_client.erl b/src/emqx_client.erl index 9e1222f11..7ebd40769 100644 --- a/src/emqx_client.erl +++ b/src/emqx_client.erl @@ -16,6 +16,7 @@ -behaviour(gen_statem). +-include("types.hrl"). -include("emqx_mqtt.hrl"). -export([start_link/0, start_link/1]). @@ -112,12 +113,12 @@ bridge_mode :: boolean(), client_id :: binary(), clean_start :: boolean(), - username :: binary() | undefined, - password :: binary() | undefined, + username :: maybe(binary()), + password :: maybe(binary()), proto_ver :: emqx_mqtt_types:version(), proto_name :: iodata(), keepalive :: non_neg_integer(), - keepalive_timer :: reference() | undefined, + keepalive_timer :: maybe(reference()), force_ping :: boolean(), paused :: boolean(), will_flag :: boolean(), diff --git a/src/emqx_cm.erl b/src/emqx_cm.erl index f8d986008..01bab4c78 100644 --- a/src/emqx_cm.erl +++ b/src/emqx_cm.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0]). @@ -46,7 +47,7 @@ -define(BATCH_SIZE, 100000). %% @doc Start the connection manager. --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?CM}, ?MODULE, [], []). @@ -121,7 +122,7 @@ set_conn_stats(ClientId, ConnPid, Stats) when is_binary(ClientId), is_pid(ConnPi ets:insert(?CONN_STATS_TAB, {Conn, Stats}). %% @doc Lookup connection pid. --spec(lookup_conn_pid(emqx_types:client_id()) -> pid() | undefined). +-spec(lookup_conn_pid(emqx_types:client_id()) -> maybe(pid())). lookup_conn_pid(ClientId) when is_binary(ClientId) -> emqx_tables:lookup_value(?CONN_TAB, ClientId). diff --git a/src/emqx_gc.erl b/src/emqx_gc.erl index 0d2334d71..17bafa8ff 100644 --- a/src/emqx_gc.erl +++ b/src/emqx_gc.erl @@ -21,6 +21,8 @@ -module(emqx_gc). +-include("types.hrl"). + -export([init/1, run/3, info/1, reset/1]). -type(opts() :: #{count => integer(), @@ -35,7 +37,7 @@ -define(ENABLED(X), (is_integer(X) andalso X > 0)). %% @doc Initialize force GC state. --spec(init(opts() | false) -> gc_state() | undefined). +-spec(init(opts() | false) -> maybe(gc_state())). init(#{count := Count, bytes := Bytes}) -> Cnt = [{cnt, {Count, Count}} || ?ENABLED(Count)], Oct = [{oct, {Bytes, Bytes}} || ?ENABLED(Bytes)], @@ -61,7 +63,7 @@ run([{K, N}|T], St) -> end. %% @doc Info of GC state. --spec(info(gc_state()) -> map() | undefined). +-spec(info(gc_state()) -> maybe(map())). info({?MODULE, St}) -> St; info(undefined) -> diff --git a/src/emqx_hooks.erl b/src/emqx_hooks.erl index de2f9e98a..b3ab3aa74 100644 --- a/src/emqx_hooks.erl +++ b/src/emqx_hooks.erl @@ -17,6 +17,7 @@ -behaviour(gen_server). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0, stop/0]). @@ -42,7 +43,7 @@ -define(TAB, ?MODULE). -define(SERVER, ?MODULE). --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], [{hibernate_after, 1000}]). diff --git a/src/emqx_metrics.erl b/src/emqx_metrics.erl index 7cd62e8ee..41176c7e2 100644 --- a/src/emqx_metrics.erl +++ b/src/emqx_metrics.erl @@ -15,6 +15,7 @@ -module(emqx_metrics). -include("logger.hrl"). +-include("types.hrl"). -include("emqx_mqtt.hrl"). -export([start_link/0]). @@ -87,7 +88,7 @@ -define(SERVER, ?MODULE). %% @doc Start the metrics server. --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []). diff --git a/src/emqx_mqueue.erl b/src/emqx_mqueue.erl index f4af00850..20a08ba9f 100644 --- a/src/emqx_mqueue.erl +++ b/src/emqx_mqueue.erl @@ -46,6 +46,7 @@ -module(emqx_mqueue). -include("emqx.hrl"). +-include("types.hrl"). -include("emqx_mqtt.hrl"). -export([init/1]). @@ -117,7 +118,7 @@ stats(#mqueue{max_len = MaxLen, dropped = Dropped} = MQ) -> [{len, len(MQ)}, {max_len, MaxLen}, {dropped, Dropped}]. %% @doc Enqueue a message. --spec(in(message(), mqueue()) -> {undefined | message(), mqueue()}). +-spec(in(message(), mqueue()) -> {maybe(message()), mqueue()}). in(#message{qos = ?QOS_0}, MQ = #mqueue{store_qos0 = false}) -> {_Dropped = undefined, MQ}; in(Msg = #message{topic = Topic}, MQ = #mqueue{default_p = Dp, diff --git a/src/emqx_pd.erl b/src/emqx_pd.erl index 4a0a65773..12603ef38 100644 --- a/src/emqx_pd.erl +++ b/src/emqx_pd.erl @@ -15,11 +15,13 @@ %% @doc The utility functions for erlang process dictionary. -module(emqx_pd). +-include("types.hrl"). + -export([update_counter/2, get_counter/1, reset_counter/1]). -type(key() :: term()). --spec(update_counter(key(), number()) -> undefined | number()). +-spec(update_counter(key(), number()) -> maybe(number())). update_counter(Key, Inc) -> put(Key, get_counter(Key) + Inc). diff --git a/src/emqx_pool.erl b/src/emqx_pool.erl index e28eafc1b..6f952db72 100644 --- a/src/emqx_pool.erl +++ b/src/emqx_pool.erl @@ -17,6 +17,7 @@ -behaviour(gen_server). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/2]). -export([submit/1, submit/2]). @@ -34,7 +35,7 @@ -type(task() :: fun() | mfa() | {fun(), Args :: list(any())}). %% @doc Start pool. --spec(start_link(atom(), pos_integer()) -> emqx_types:startlink_ret()). +-spec(start_link(atom(), pos_integer()) -> startlink_ret()). start_link(Pool, Id) -> gen_server:start_link({local, emqx_misc:proc_name(?MODULE, Id)}, ?MODULE, [Pool, Id], [{hibernate_after, 1000}]). diff --git a/src/emqx_router.erl b/src/emqx_router.erl index 510b4ae37..224a14e48 100644 --- a/src/emqx_router.erl +++ b/src/emqx_router.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -include_lib("ekka/include/ekka.hrl"). %% Mnesia bootstrap @@ -65,7 +66,7 @@ mnesia(copy) -> %% Start a router %%------------------------------------------------------------------------------ --spec(start_link(atom(), pos_integer()) -> emqx_types:startlink_ret()). +-spec(start_link(atom(), pos_integer()) -> startlink_ret()). start_link(Pool, Id) -> gen_server:start_link({local, emqx_misc:proc_name(?MODULE, Id)}, ?MODULE, [Pool, Id], [{hibernate_after, 1000}]). diff --git a/src/emqx_router_helper.erl b/src/emqx_router_helper.erl index 84a6c7637..9772f8050 100644 --- a/src/emqx_router_helper.erl +++ b/src/emqx_router_helper.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). %% Mnesia bootstrap -export([mnesia/1]). @@ -61,7 +62,7 @@ mnesia(copy) -> %%------------------------------------------------------------------------------ %% @doc Starts the router helper --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). diff --git a/src/emqx_session.erl b/src/emqx_session.erl index 289fe1ce5..06d026e8c 100644 --- a/src/emqx_session.erl +++ b/src/emqx_session.erl @@ -43,6 +43,7 @@ -include("emqx.hrl"). -include("emqx_mqtt.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/1]). -export([info/1, attrs/1]). @@ -77,7 +78,7 @@ client_id :: binary(), %% Username - username :: binary() | undefined, + username :: maybe(binary()), %% Connection pid binding with session conn_pid :: pid(), @@ -107,7 +108,7 @@ retry_interval = 20000 :: timeout(), %% Retry Timer - retry_timer :: reference() | undefined, + retry_timer :: maybe(reference()), %% All QoS1, QoS2 messages published to when client is disconnected. %% QoS 1 and QoS 2 messages pending transmission to the Client. @@ -125,19 +126,19 @@ await_rel_timeout = 20000 :: timeout(), %% Awaiting PUBREL Timer - await_rel_timer :: reference() | undefined, + await_rel_timer :: maybe(reference()), %% Session Expiry Interval expiry_interval = 7200 :: timeout(), %% Expired Timer - expiry_timer :: reference() | undefined, + expiry_timer :: maybe(reference()), %% Enable Stats enable_stats :: boolean(), %% Stats timer - stats_timer :: reference() | undefined, + stats_timer :: maybe(reference()), %% GC State gc_state, @@ -147,7 +148,7 @@ will_msg :: emqx:message(), - will_delay_timer :: reference() | undefined + will_delay_timer :: maybe(reference()) }). diff --git a/src/emqx_session_sup.erl b/src/emqx_session_sup.erl index 576193800..3e360794d 100644 --- a/src/emqx_session_sup.erl +++ b/src/emqx_session_sup.erl @@ -17,6 +17,7 @@ -behaviour(gen_server). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/1]). -export([start_session/1, count_sessions/0]). @@ -38,7 +39,7 @@ -define(BATCH_EXIT, 100000). %% @doc Start session supervisor. --spec(start_link(map()) -> emqx_types:startlink_ret()). +-spec(start_link(map()) -> startlink_ret()). start_link(SessSpec) when is_map(SessSpec) -> gen_server:start_link({local, ?SUP}, ?MODULE, [SessSpec], []). @@ -47,7 +48,7 @@ start_link(SessSpec) when is_map(SessSpec) -> %%------------------------------------------------------------------------------ %% @doc Start a session. --spec(start_session(map()) -> emqx_types:startlink_ret()). +-spec(start_session(map()) -> startlink_ret()). start_session(SessAttrs) -> gen_server:call(?SUP, {start_session, SessAttrs}, infinity). diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index 51884efa9..5c4b46217 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -19,6 +19,7 @@ -include("emqx.hrl"). -include("emqx_mqtt.hrl"). -include("logger.hrl"). +-include("types.hrl"). %% Mnesia bootstrap -export([mnesia/1]). @@ -70,7 +71,7 @@ mnesia(copy) -> %% API %%------------------------------------------------------------------------------ --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []). diff --git a/src/emqx_sm.erl b/src/emqx_sm.erl index 93eb827a4..2feb42433 100644 --- a/src/emqx_sm.erl +++ b/src/emqx_sm.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0]). @@ -55,7 +56,7 @@ -define(BATCH_SIZE, 100000). --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?SM}, ?MODULE, [], []). diff --git a/src/emqx_sm_locker.erl b/src/emqx_sm_locker.erl index bdb53038a..b7361f102 100644 --- a/src/emqx_sm_locker.erl +++ b/src/emqx_sm_locker.erl @@ -15,13 +15,14 @@ -module(emqx_sm_locker). -include("emqx.hrl"). +-include("types.hrl"). -export([start_link/0]). -export([trans/2, trans/3]). -export([lock/1, lock/2, unlock/1]). --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> ekka_locker:start_link(?MODULE). @@ -29,7 +30,7 @@ start_link() -> trans(ClientId, Fun) -> trans(ClientId, Fun, undefined). --spec(trans(emqx_types:client_id() | undefined, +-spec(trans(maybe(emqx_types:client_id()), fun(([node()])-> any()), ekka_locker:piggyback()) -> any()). trans(undefined, Fun, _Piggyback) -> Fun([]); diff --git a/src/emqx_sm_registry.erl b/src/emqx_sm_registry.erl index 535ca4a64..d2aede1ed 100644 --- a/src/emqx_sm_registry.erl +++ b/src/emqx_sm_registry.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0]). -export([is_enabled/0]). @@ -36,7 +37,7 @@ -type(session_pid() :: pid()). %% @doc Start the global session manager. --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?REGISTRY}, ?MODULE, [], []). diff --git a/src/emqx_stats.erl b/src/emqx_stats.erl index 2e9c06759..a7cbbb314 100644 --- a/src/emqx_stats.erl +++ b/src/emqx_stats.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0, start_link/1, stop/0]). @@ -82,11 +83,11 @@ -type opts() :: #{tick_ms := timeout()}. %% @doc Start stats server --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> start_link(#{tick_ms => timer:seconds(1)}). --spec(start_link(opts()) -> emqx_types:startlink_ret()). +-spec(start_link(opts()) -> startlink_ret()). start_link(Opts) -> gen_server:start_link({local, ?SERVER}, ?MODULE, Opts, []). @@ -112,7 +113,7 @@ getstats() -> end. %% @doc Get stats by name --spec(getstat(atom()) -> non_neg_integer() | undefined). +-spec(getstat(atom()) -> maybe(non_neg_integer())). getstat(Name) -> case ets:lookup(?TAB, Name) of [{Name, Val}] -> Val; diff --git a/src/emqx_sys_mon.erl b/src/emqx_sys_mon.erl index 1acbca98a..44a256f3f 100644 --- a/src/emqx_sys_mon.erl +++ b/src/emqx_sys_mon.erl @@ -17,6 +17,7 @@ -behavior(gen_server). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, @@ -24,10 +25,16 @@ %% compress unused warning -export([procinfo/1]). +-type(option() :: {long_gc, false | pos_integer()} + | {long_schedule, false | pos_integer()} + | {large_heap, pos_integer()} + | {busy_port, boolean()} + | {busy_dist_port, boolean()}). + -define(SYSMON, ?MODULE). %% @doc Start system monitor --spec(start_link(Opts :: list(tuple())) -> emqx_types:startlink_ret()). +-spec(start_link(list(option())) -> startlink_ret()). start_link(Opts) -> gen_server:start_link({local, ?SYSMON}, ?MODULE, [Opts], []). diff --git a/src/emqx_types.erl b/src/emqx_types.erl index dcbcb8f5b..d84b1099a 100644 --- a/src/emqx_types.erl +++ b/src/emqx_types.erl @@ -15,9 +15,9 @@ -module(emqx_types). -include("emqx.hrl"). +-include("types.hrl"). -export_type([zone/0]). --export_type([startlink_ret/0, ok_or_error/1]). -export_type([pubsub/0, topic/0, subid/0, subopts/0]). -export_type([client_id/0, username/0, password/0, peername/0, protocol/0]). -export_type([credentials/0, session/0]). @@ -28,8 +28,6 @@ -export_type([alarm/0, plugin/0, command/0]). -type(zone() :: atom()). --type(startlink_ret() :: {ok, pid()} | ignore | {error, term()}). --type(ok_or_error(Reason) :: ok | {error, Reason}). -type(pubsub() :: publish | subscribe). -type(topic() :: binary()). -type(subid() :: binary() | atom()). @@ -39,8 +37,8 @@ }). -type(session() :: #session{}). -type(client_id() :: binary() | atom()). --type(username() :: binary() | undefined). --type(password() :: binary() | undefined). +-type(username() :: maybe(binary())). +-type(password() :: maybe(binary())). -type(peername() :: {inet:ip_address(), inet:port_number()}). -type(protocol() :: mqtt | 'mqtt-sn' | coap | stomp | none | atom()). -type(credentials() :: #{client_id := client_id(), diff --git a/src/emqx_zone.erl b/src/emqx_zone.erl index 9a1ad7e69..522da1271 100644 --- a/src/emqx_zone.erl +++ b/src/emqx_zone.erl @@ -18,6 +18,7 @@ -include("emqx.hrl"). -include("logger.hrl"). +-include("types.hrl"). -export([start_link/0]). -export([get_env/2, get_env/3]). @@ -33,17 +34,17 @@ -define(TAB, ?MODULE). -define(SERVER, ?MODULE). --spec(start_link() -> emqx_types:startlink_ret()). +-spec(start_link() -> startlink_ret()). start_link() -> gen_server:start_link({local, ?SERVER}, ?MODULE, [], []). --spec(get_env(emqx_types:zone() | undefined, atom()) -> undefined | term()). +-spec(get_env(maybe(emqx_types:zone()), atom()) -> maybe(term())). get_env(undefined, Key) -> emqx_config:get_env(Key); get_env(Zone, Key) -> get_env(Zone, Key, undefined). --spec(get_env(emqx_types:zone() | undefined, atom(), term()) -> undefined | term()). +-spec(get_env(maybe(emqx_types:zone()), atom(), term()) -> maybe(term())). get_env(undefined, Key, Def) -> emqx_config:get_env(Key, Def); get_env(Zone, Key, Def) -> From 269b74232a26cc46829cb42b090a18816164b615 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 19 Feb 2019 11:08:57 +0800 Subject: [PATCH 7/7] Introduce some common types --- include/types.hrl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/types.hrl diff --git a/include/types.hrl b/include/types.hrl new file mode 100644 index 000000000..8032bfe7e --- /dev/null +++ b/include/types.hrl @@ -0,0 +1,22 @@ +%% Copyright (c) 2013-2019 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. + +-type(maybe(T) :: undefined | T). + +-type(startlink_ret() :: {ok, pid()} | ignore | {error, term()}). + +-type(ok_or_error(Reason) :: ok | {error, Reason}). + +-type(ok_or_error(Value, Reason) :: {ok, Value} | {error, Reason}). +