From 5a49196a07941f99cffc645ae05036fe94c6babd Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Thu, 16 Feb 2017 11:28:35 +0800 Subject: [PATCH] Update copyright info and format code --- src/emqttd_cm_sup.erl | 5 ++++- src/emqttd_parser.erl | 12 +++++++----- src/emqttd_plugins.erl | 4 +++- src/emqttd_pmon.erl | 11 +++++++---- src/emqttd_sm_sup.erl | 5 ++++- src/emqttd_ws.erl | 4 +++- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/emqttd_cm_sup.erl b/src/emqttd_cm_sup.erl index dfa623cc3..fc01ea649 100644 --- a/src/emqttd_cm_sup.erl +++ b/src/emqttd_cm_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% 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 "). + -include("emqttd.hrl"). %% API diff --git a/src/emqttd_parser.erl b/src/emqttd_parser.erl index d6c09c42e..669f4aab2 100644 --- a/src/emqttd_parser.erl +++ b/src/emqttd_parser.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% 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 "). + -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, diff --git a/src/emqttd_plugins.erl b/src/emqttd_plugins.erl index 78b543440..f126f631c 100644 --- a/src/emqttd_plugins.erl +++ b/src/emqttd_plugins.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% 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 "). + -include("emqttd.hrl"). -export([init/0]). diff --git a/src/emqttd_pmon.erl b/src/emqttd_pmon.erl index e5f286eea..ebe691ad4 100644 --- a/src/emqttd_pmon.erl +++ b/src/emqttd_pmon.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016-2017 Feng Lee . 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 "). --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]}) -> diff --git a/src/emqttd_sm_sup.erl b/src/emqttd_sm_sup.erl index c43f89f80..efabadb96 100644 --- a/src/emqttd_sm_sup.erl +++ b/src/emqttd_sm_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% 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 "). + -include("emqttd.hrl"). -define(SM, emqttd_sm). diff --git a/src/emqttd_ws.erl b/src/emqttd_ws.erl index a5b3b344f..8c483344e 100644 --- a/src/emqttd_ws.erl +++ b/src/emqttd_ws.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2017 Feng Lee . +%% 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 "). + -export([handle_request/1, ws_loop/3]). %% WebSocket Loop State