From 2e438cfaadea3f889112af4d00ff8195ba865e08 Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Sun, 3 May 2026 15:39:21 +0800 Subject: [PATCH] fix spec --- src/dns_proxy/dns_resolver.erl | 2 +- src/policy/maxwell_redis_channel.erl | 2 +- src/quic/sdlan_quic_channel_sup.erl | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dns_proxy/dns_resolver.erl b/src/dns_proxy/dns_resolver.erl index 068c6cd..08693d5 100644 --- a/src/dns_proxy/dns_resolver.erl +++ b/src/dns_proxy/dns_resolver.erl @@ -49,7 +49,7 @@ resolve(IpPacket) when is_binary(IpPacket) -> %%% 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}|_]}) -> %% 查找是否是内置的域名 case sdlan_hostname_regedit:lookup(QName) of diff --git a/src/policy/maxwell_redis_channel.erl b/src/policy/maxwell_redis_channel.erl index 9283be4..02e2ade 100644 --- a/src/policy/maxwell_redis_channel.erl +++ b/src/policy/maxwell_redis_channel.erl @@ -112,7 +112,7 @@ parse(Command = #command{stage = parse_arg, args = Args, arg_num = ArgNum, data end. %% redis数据返回格式化 --spec encode(tuple() | binary() | list()) -> iolist(). +-spec encode(tuple() | binary() | integer() | list()) -> iolist(). encode({single_line, Arg}) when is_binary(Arg) -> [<<$+>>, Arg, <<$\r, $\n>>]; encode({error, Arg}) when is_binary(Arg) -> diff --git a/src/quic/sdlan_quic_channel_sup.erl b/src/quic/sdlan_quic_channel_sup.erl index f920070..345ed63 100644 --- a/src/quic/sdlan_quic_channel_sup.erl +++ b/src/quic/sdlan_quic_channel_sup.erl @@ -39,10 +39,8 @@ start_link() -> %% restart strategy, maximum restart frequency and child %% 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()}). + {ok, {SupFlags :: supervisor:sup_flags(), [ChildSpec :: supervisor:child_spec()]}} + | ignore). init([]) -> SupFlags = #{strategy => simple_one_for_one, intensity => 0, period => 1},