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");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
|
@ -15,10 +15,13 @@
|
|||
%%--------------------------------------------------------------------
|
||||
|
||||
%% @doc Client Manager Supervisor.
|
||||
|
||||
-module(emqttd_cm_sup).
|
||||
|
||||
-behaviour(supervisor).
|
||||
|
||||
-author("Feng Lee <feng@emqtt.io>").
|
||||
|
||||
-include("emqttd.hrl").
|
||||
|
||||
%% 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");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
|
@ -17,6 +17,8 @@
|
|||
%% @doc MQTT Packet Parser
|
||||
-module(emqttd_parser).
|
||||
|
||||
-author("Feng Lee <feng@emqtt.io>").
|
||||
|
||||
-include("emqttd.hrl").
|
||||
|
||||
-include("emqttd_protocol.hrl").
|
||||
|
@ -26,9 +28,9 @@
|
|||
|
||||
-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
|
||||
-spec(new(Opts :: [option()]) -> parser()).
|
||||
|
@ -86,7 +88,7 @@ parse_frame(Bin, #mqtt_packet_header{type = Type, qos = Qos} = Header, Length)
|
|||
WillRetain : 1,
|
||||
WillQos : 2,
|
||||
WillFlag : 1,
|
||||
CleanSession : 1,
|
||||
CleanSess : 1,
|
||||
_Reserved : 1,
|
||||
KeepAlive : 16/big,
|
||||
Rest3/binary>> = Rest2,
|
||||
|
@ -104,7 +106,7 @@ parse_frame(Bin, #mqtt_packet_header{type = Type, qos = Qos} = Header, Length)
|
|||
will_retain = bool(WillRetain),
|
||||
will_qos = WillQos,
|
||||
will_flag = bool(WillFlag),
|
||||
clean_sess = bool(CleanSession),
|
||||
clean_sess = bool(CleanSess),
|
||||
keep_alive = KeepAlive,
|
||||
client_id = ClientId,
|
||||
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");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
|
@ -16,6 +16,8 @@
|
|||
|
||||
-module(emqttd_plugins).
|
||||
|
||||
-author("Feng Lee <feng@emqtt.io>").
|
||||
|
||||
-include("emqttd.hrl").
|
||||
|
||||
-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");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
|
@ -18,11 +18,14 @@
|
|||
|
||||
-author("Feng Lee <feng@emqtt.io>").
|
||||
|
||||
-type(pmon() :: {?MODULE, map()}).
|
||||
|
||||
-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()).
|
||||
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");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
|
@ -15,10 +15,13 @@
|
|||
%%--------------------------------------------------------------------
|
||||
|
||||
%% @doc Session Manager Supervisor.
|
||||
|
||||
-module(emqttd_sm_sup).
|
||||
|
||||
-behaviour(supervisor).
|
||||
|
||||
-author("Feng Lee <feng@emqtt.io>").
|
||||
|
||||
-include("emqttd.hrl").
|
||||
|
||||
-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");
|
||||
%% you may not use this file except in compliance with the License.
|
||||
|
@ -16,6 +16,8 @@
|
|||
|
||||
-module(emqttd_ws).
|
||||
|
||||
-author("Feng Lee <feng@emqtt.io>").
|
||||
|
||||
-export([handle_request/1, ws_loop/3]).
|
||||
|
||||
%% WebSocket Loop State
|
||||
|
|
Loading…
Reference in New Issue