replace emqttd_opts:g/3 with proplists:get_value/3

This commit is contained in:
Feng 2016-02-13 18:36:09 +08:00
parent 49a979a25e
commit 541af6256d
1 changed files with 4 additions and 2 deletions

View File

@ -23,6 +23,8 @@
-include("emqttd_internal.hrl"). -include("emqttd_internal.hrl").
-import(proplists, [get_value/2, get_value/3]).
%% API %% API
-export([init/3, info/1, clientid/1, client/1, session/1]). -export([init/3, info/1, clientid/1, client/1, session/1]).
@ -49,8 +51,8 @@
%% @doc Init protocol %% @doc Init protocol
init(Peername, SendFun, Opts) -> init(Peername, SendFun, Opts) ->
MaxLen = emqttd_opts:g(max_clientid_len, Opts, ?MAX_CLIENTID_LEN), MaxLen = get_value(max_clientid_len, Opts, ?MAX_CLIENTID_LEN),
WsInitialHeaders = emqttd_opts:g(ws_initial_headers, Opts), WsInitialHeaders = get_value(ws_initial_headers, Opts),
#proto_state{peername = Peername, #proto_state{peername = Peername,
sendfun = SendFun, sendfun = SendFun,
max_clientid_len = MaxLen, max_clientid_len = MaxLen,