Browse Source

Update copyright info and format code

Feng Lee 9 years atrás
parent
commit
5a49196a07
6 changed files with 27 additions and 12 deletions
  1. 4 1
      src/emqttd_cm_sup.erl
  2. 7 5
      src/emqttd_parser.erl
  3. 3 1
      src/emqttd_plugins.erl
  4. 6 3
      src/emqttd_pmon.erl
  5. 4 1
      src/emqttd_sm_sup.erl
  6. 3 1
      src/emqttd_ws.erl

+ 4 - 1
src/emqttd_cm_sup.erl

@@ -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

+ 7 - 5
src/emqttd_parser.erl

@@ -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,

+ 3 - 1
src/emqttd_plugins.erl

@@ -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]).

+ 6 - 3
src/emqttd_pmon.erl

@@ -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>").
 
+-export([new/0, monitor/2, demonitor/2, erase/2]).
+
 -type(pmon() :: {?MODULE, map()}).
 
--export([new/0, monitor/2, demonitor/2, erase/2]).
+-export_type([pmon/0]).
 
-new() -> {?MODULE, [maps:new()]}.
+new() ->
+    {?MODULE, [maps:new()]}.
 
 -spec(monitor(pid(), pmon()) -> pmon()).
 monitor(Pid, PM = {?MODULE, [M]}) ->

+ 4 - 1
src/emqttd_sm_sup.erl

@@ -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).

+ 3 - 1
src/emqttd_ws.erl

@@ -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