فهرست منبع

fix(eqmx_sasl): Dialyzer warning

Zaiming Shi 5 سال پیش
والد
کامیت
4cfe4e9940
4فایلهای تغییر یافته به همراه6 افزوده شده و 10 حذف شده
  1. 2 2
      apps/emqx_sasl/src/emqx_sasl_app.erl
  2. 2 6
      apps/emqx_sasl/src/emqx_sasl_scram.erl
  3. 1 1
      apps/emqx_sn/src/emqx_sn_gateway.erl
  4. 1 1
      rebar.config

+ 2 - 2
apps/emqx_sasl/src/emqx_sasl_app.erl

@@ -30,7 +30,7 @@
 
 start(_Type, _Args) ->
     ok = emqx_sasl:init(),
-    emqx_sasl:load(),
+    _ = emqx_sasl:load(),
     emqx_sasl_cli:load(),
     supervisor:start_link({local, ?MODULE}, ?MODULE, []).
 
@@ -43,4 +43,4 @@ stop(_State) ->
 %%--------------------------------------------------------------------
 
 init([]) ->
-    {ok, { {one_for_all, 1, 10}, []} }.
+    {ok, { {one_for_all, 1, 10}, []} }.

+ 2 - 6
apps/emqx_sasl/src/emqx_sasl_scram.erl

@@ -217,12 +217,8 @@ nonce() ->
     base64:encode([$a + rand:uniform(26) || _ <- lists:seq(1, 10)]).
 
 pbkdf2_sha_1(Password, Salt, IterationCount) ->
-    case pbkdf2:pbkdf2(sha, Password, Salt, IterationCount) of
-        {ok, Bin} ->
-            pbkdf2:to_hex(Bin);
-        {error, Reason} ->
-            error(Reason)
-    end.
+    {ok, Bin} = pbkdf2:pbkdf2(sha, Password, Salt, IterationCount),
+    pbkdf2:to_hex(Bin).
 
 -if(?OTP_RELEASE >= 23).
 hmac(Key, Data) ->

+ 1 - 1
apps/emqx_sn/src/emqx_sn_gateway.erl

@@ -209,7 +209,7 @@ idle(cast, {incoming, ?SN_PUBLISH_MSG(#mqtt_sn_flags{qos = ?QOS_NEG1,
             emqx_broker:publish(Msg);
         false ->
             ok
-    end;
+    end,
     ?LOG(debug, "Client id=~p receives a publish with QoS=-1 in idle mode!", [ClientId], State),
     {keep_state_and_data, State#state.idle_timeout};
 

+ 1 - 1
rebar.config

@@ -44,7 +44,7 @@
     , {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.2"}}}
     , {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.0"}}}
     , {replayq, {git, "https://github.com/emqx/replayq", {tag, "v0.2.0"}}}
-    , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.3"}}}
+    , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}}
     , {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}}
     , {rulesql, {git, "https://github.com/emqx/rulesql", {tag, "0.1.2"}}}
     , {getopt, "1.0.1"}