解决静态分析报错的问题
This commit is contained in:
parent
8206710798
commit
323c4c199d
@ -177,7 +177,7 @@ resolver0(Packet, QueryMsg = #dns_message{qc = 1, questions = [Question = #dns_q
|
|||||||
{ok, Resp};
|
{ok, Resp};
|
||||||
Error ->
|
Error ->
|
||||||
lager:debug("[dns_handler] parse reply get error: ~p", [Error]),
|
lager:debug("[dns_handler] parse reply get error: ~p", [Error]),
|
||||||
Error
|
{error, Error}
|
||||||
end
|
end
|
||||||
after 5000 ->
|
after 5000 ->
|
||||||
{error, timeout}
|
{error, timeout}
|
||||||
@ -186,7 +186,7 @@ resolver0(Packet, QueryMsg = #dns_message{qc = 1, questions = [Question = #dns_q
|
|||||||
end;
|
end;
|
||||||
resolver0(_, Error) ->
|
resolver0(_, Error) ->
|
||||||
lager:warning("[dns_handler] decode dns query get error: ~p", [Error]),
|
lager:warning("[dns_handler] decode dns query get error: ~p", [Error]),
|
||||||
Error.
|
{error, Error}.
|
||||||
|
|
||||||
-spec forward_to_upstream(Ref :: reference(), Request :: binary(), QueryMsg :: #dns_message{}) -> no_return().
|
-spec forward_to_upstream(Ref :: reference(), Request :: binary(), QueryMsg :: #dns_message{}) -> no_return().
|
||||||
forward_to_upstream(Ref, Request, QueryMsg) ->
|
forward_to_upstream(Ref, Request, QueryMsg) ->
|
||||||
|
|||||||
@ -38,11 +38,6 @@ start_link() ->
|
|||||||
%% this function is called by the new process to find out about
|
%% this function is called by the new process to find out about
|
||||||
%% restart strategy, maximum restart frequency and child
|
%% restart strategy, maximum restart frequency and child
|
||||||
%% specifications.
|
%% specifications.
|
||||||
-spec(init(Args :: term()) ->
|
|
||||||
{ok, {SupFlags :: {RestartStrategy :: supervisor:strategy(),
|
|
||||||
MaxR :: non_neg_integer(), MaxT :: non_neg_integer()},
|
|
||||||
[ChildSpec :: supervisor:child_spec()]}}
|
|
||||||
| ignore | {error, Reason :: term()}).
|
|
||||||
init([]) ->
|
init([]) ->
|
||||||
SupFlags = #{strategy => simple_one_for_one, intensity => 0, period => 1},
|
SupFlags = #{strategy => simple_one_for_one, intensity => 0, period => 1},
|
||||||
Spec = #{
|
Spec = #{
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
-module(dns_zone_loader).
|
|
||||||
-export([load/1]).
|
|
||||||
|
|
||||||
-include_lib("dns_erlang/include/dns.hrl").
|
|
||||||
|
|
||||||
load(Path) ->
|
|
||||||
{ok, Bin} = file:read_file(Path),
|
|
||||||
{ok, Records} = dns_zone:decode(Bin), % dns_erlang 提供
|
|
||||||
lists:foreach(fun(R) ->
|
|
||||||
Name = R#dns_rr.name,
|
|
||||||
dns_cache:insert(Name, R)
|
|
||||||
end, Records),
|
|
||||||
ok.
|
|
||||||
Loading…
x
Reference in New Issue
Block a user