Update copyright info and format code
This commit is contained in:
parent
a54076cf0a
commit
5a49196a07
|
@ -1,5 +1,5 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2012-2017 Feng Lee <feng@emqtt.io>.
|
%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io)
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
|
@ -15,10 +15,13 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
%% @doc Client Manager Supervisor.
|
%% @doc Client Manager Supervisor.
|
||||||
|
|
||||||
-module(emqttd_cm_sup).
|
-module(emqttd_cm_sup).
|
||||||
|
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
|
|
||||||
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
|
|
||||||
%% API
|
%% API
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2012-2017 Feng Lee <feng@emqtt.io>.
|
%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io)
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
|
@ -17,6 +17,8 @@
|
||||||
%% @doc MQTT Packet Parser
|
%% @doc MQTT Packet Parser
|
||||||
-module(emqttd_parser).
|
-module(emqttd_parser).
|
||||||
|
|
||||||
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
|
|
||||||
-include("emqttd_protocol.hrl").
|
-include("emqttd_protocol.hrl").
|
||||||
|
@ -26,9 +28,9 @@
|
||||||
|
|
||||||
-record(mqtt_packet_limit, {max_packet_size}).
|
-record(mqtt_packet_limit, {max_packet_size}).
|
||||||
|
|
||||||
-type option() :: {atom(), any()}.
|
-type(option() :: {atom(), any()}).
|
||||||
|
|
||||||
-type parser() :: fun( (binary()) -> any() ).
|
-type(parser() :: fun( (binary()) -> any() )).
|
||||||
|
|
||||||
%% @doc Initialize a parser
|
%% @doc Initialize a parser
|
||||||
-spec(new(Opts :: [option()]) -> parser()).
|
-spec(new(Opts :: [option()]) -> parser()).
|
||||||
|
@ -86,7 +88,7 @@ parse_frame(Bin, #mqtt_packet_header{type = Type, qos = Qos} = Header, Length)
|
||||||
WillRetain : 1,
|
WillRetain : 1,
|
||||||
WillQos : 2,
|
WillQos : 2,
|
||||||
WillFlag : 1,
|
WillFlag : 1,
|
||||||
CleanSession : 1,
|
CleanSess : 1,
|
||||||
_Reserved : 1,
|
_Reserved : 1,
|
||||||
KeepAlive : 16/big,
|
KeepAlive : 16/big,
|
||||||
Rest3/binary>> = Rest2,
|
Rest3/binary>> = Rest2,
|
||||||
|
@ -104,7 +106,7 @@ parse_frame(Bin, #mqtt_packet_header{type = Type, qos = Qos} = Header, Length)
|
||||||
will_retain = bool(WillRetain),
|
will_retain = bool(WillRetain),
|
||||||
will_qos = WillQos,
|
will_qos = WillQos,
|
||||||
will_flag = bool(WillFlag),
|
will_flag = bool(WillFlag),
|
||||||
clean_sess = bool(CleanSession),
|
clean_sess = bool(CleanSess),
|
||||||
keep_alive = KeepAlive,
|
keep_alive = KeepAlive,
|
||||||
client_id = ClientId,
|
client_id = ClientId,
|
||||||
will_topic = WillTopic,
|
will_topic = WillTopic,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2012-2017 Feng Lee <feng@emqtt.io>.
|
%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io)
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
-module(emqttd_plugins).
|
-module(emqttd_plugins).
|
||||||
|
|
||||||
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
|
|
||||||
-export([init/0]).
|
-export([init/0]).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2016-2017 Feng Lee <feng@emqtt.io>. All Rights Reserved.
|
%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io)
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
|
@ -18,11 +18,14 @@
|
||||||
|
|
||||||
-author("Feng Lee <feng@emqtt.io>").
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-type(pmon() :: {?MODULE, map()}).
|
|
||||||
|
|
||||||
-export([new/0, monitor/2, demonitor/2, erase/2]).
|
-export([new/0, monitor/2, demonitor/2, erase/2]).
|
||||||
|
|
||||||
new() -> {?MODULE, [maps:new()]}.
|
-type(pmon() :: {?MODULE, map()}).
|
||||||
|
|
||||||
|
-export_type([pmon/0]).
|
||||||
|
|
||||||
|
new() ->
|
||||||
|
{?MODULE, [maps:new()]}.
|
||||||
|
|
||||||
-spec(monitor(pid(), pmon()) -> pmon()).
|
-spec(monitor(pid(), pmon()) -> pmon()).
|
||||||
monitor(Pid, PM = {?MODULE, [M]}) ->
|
monitor(Pid, PM = {?MODULE, [M]}) ->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2012-2017 Feng Lee <feng@emqtt.io>.
|
%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io)
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
|
@ -15,10 +15,13 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
%% @doc Session Manager Supervisor.
|
%% @doc Session Manager Supervisor.
|
||||||
|
|
||||||
-module(emqttd_sm_sup).
|
-module(emqttd_sm_sup).
|
||||||
|
|
||||||
-behaviour(supervisor).
|
-behaviour(supervisor).
|
||||||
|
|
||||||
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-include("emqttd.hrl").
|
-include("emqttd.hrl").
|
||||||
|
|
||||||
-define(SM, emqttd_sm).
|
-define(SM, emqttd_sm).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Copyright (c) 2012-2017 Feng Lee <feng@emqtt.io>.
|
%% Copyright (c) 2013-2017 EMQ Enterprise, Inc. (http://emqtt.io)
|
||||||
%%
|
%%
|
||||||
%% Licensed under the Apache License, Version 2.0 (the "License");
|
%% Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
%% you may not use this file except in compliance with the License.
|
%% you may not use this file except in compliance with the License.
|
||||||
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
-module(emqttd_ws).
|
-module(emqttd_ws).
|
||||||
|
|
||||||
|
-author("Feng Lee <feng@emqtt.io>").
|
||||||
|
|
||||||
-export([handle_request/1, ws_loop/3]).
|
-export([handle_request/1, ws_loop/3]).
|
||||||
|
|
||||||
%% WebSocket Loop State
|
%% WebSocket Loop State
|
||||||
|
|
Loading…
Reference in New Issue