This commit is contained in:
anlicheng 2026-05-03 15:39:21 +08:00
parent bb5e0ddc17
commit 2e438cfaad
3 changed files with 4 additions and 6 deletions

View File

@ -49,7 +49,7 @@ resolve(IpPacket) when is_binary(IpPacket) ->
%%% Internal functions %%% Internal functions
%%%=================================================================== %%%===================================================================
-spec resolve0(Packet :: binary()) -> {ok, Resp :: binary()} | {error, Reason :: any()}. -spec resolve0(Packet :: #dns_message{}) -> {ok, Resp :: binary()} | {error, Reason :: any()}.
resolve0(QueryMsg = #dns_message{qc = 1, questions = [#dns_query{name = QName, type = QType, class = QClass}|_]}) -> resolve0(QueryMsg = #dns_message{qc = 1, questions = [#dns_query{name = QName, type = QType, class = QClass}|_]}) ->
%% %%
case sdlan_hostname_regedit:lookup(QName) of case sdlan_hostname_regedit:lookup(QName) of

View File

@ -112,7 +112,7 @@ parse(Command = #command{stage = parse_arg, args = Args, arg_num = ArgNum, data
end. end.
%% redis数据返回格式化 %% redis数据返回格式化
-spec encode(tuple() | binary() | list()) -> iolist(). -spec encode(tuple() | binary() | integer() | list()) -> iolist().
encode({single_line, Arg}) when is_binary(Arg) -> encode({single_line, Arg}) when is_binary(Arg) ->
[<<$+>>, Arg, <<$\r, $\n>>]; [<<$+>>, Arg, <<$\r, $\n>>];
encode({error, Arg}) when is_binary(Arg) -> encode({error, Arg}) when is_binary(Arg) ->

View File

@ -39,10 +39,8 @@ start_link() ->
%% restart strategy, maximum restart frequency and child %% restart strategy, maximum restart frequency and child
%% specifications. %% specifications.
-spec(init(Args :: term()) -> -spec(init(Args :: term()) ->
{ok, {SupFlags :: {RestartStrategy :: supervisor:strategy(), {ok, {SupFlags :: supervisor:sup_flags(), [ChildSpec :: supervisor:child_spec()]}}
MaxR :: non_neg_integer(), MaxT :: non_neg_integer()}, | ignore).
[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},