From be9df9466a080d755042b1ef61dc32f4e60caf41 Mon Sep 17 00:00:00 2001 From: William Yang Date: Thu, 30 Nov 2023 10:23:08 +0100 Subject: [PATCH] chore: tmp fix dialyzer otp26 --- rebar.config | 7 +++++++ src/quicer.erl | 2 +- src/quicer_app.erl | 2 +- src/quicer_listener.erl | 4 ++-- src/quicer_listener_sup.erl | 2 +- src/quicer_server_conn_callback.erl | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rebar.config b/rebar.config index 8fe0b2ee..7410bb70 100644 --- a/rebar.config +++ b/rebar.config @@ -64,3 +64,10 @@ {main, "README.md"}, {source_url, "https://github.com/emqx/quic"} ]}. + +{dialyzer, [ + {warnings, [unmatched_returns, error_handling, no_unknown]}, + {plt_apps, all_apps}, + {statistics, true} + ] +}. diff --git a/src/quicer.erl b/src/quicer.erl index 454fd40c..6809d010 100644 --- a/src/quicer.erl +++ b/src/quicer.erl @@ -1071,7 +1071,7 @@ handoff_stream(Stream, NewOwner, HandoffData) -> ActiveN =/= false andalso quicer:setopt(Stream, active, false), Res = case forward_stream_msgs(Stream, NewOwner) of ok -> - quicer:controlling_process(Stream, NewOwner), + _ = quicer:controlling_process(Stream, NewOwner), NewOwner ! {handoff_done, Stream, HandoffData}, ok; {error, _} = Other -> diff --git a/src/quicer_app.erl b/src/quicer_app.erl index 0b88baf4..56484f97 100644 --- a/src/quicer_app.erl +++ b/src/quicer_app.erl @@ -21,7 +21,7 @@ ]). start(_StartType, _StartArgs) -> - quicer:open_lib(), + _ = quicer:open_lib(), _ = quicer:reg_open(application:get_env(quicer, profile, quic_execution_profile_low_latency)), quicer_sup:start_link(). diff --git a/src/quicer_listener.erl b/src/quicer_listener.erl index e495439c..4ddf56b4 100644 --- a/src/quicer_listener.erl +++ b/src/quicer_listener.erl @@ -89,7 +89,7 @@ init([Name, ListenOn, { #{conn_acceptors := N, alpn := Alpn} = LOpts, process_flag(trap_exit, true), {ok, L} = quicer:listen(ListenOn, maps:without([conn_acceptors], LOpts)), {ok, ConnSup} = supervisor:start_link(quicer_conn_acceptor_sup, [L, Opts]), - [{ok, _} = supervisor:start_child(ConnSup, [ConnSup]) || _ <- lists:seq(1, N)], + _ = [{ok, _} = supervisor:start_child(ConnSup, [ConnSup]) || _ <- lists:seq(1, N)], {ok, #state{ name = Name , listener = L , conn_sup = ConnSup @@ -156,5 +156,5 @@ handle_info(_Info, State) -> State :: term()) -> any(). terminate(_Reason, #state{listener = L}) -> %% nif listener has no owner process so we need to close it explicitly. - quicer:close_listener(L), + _ = quicer:close_listener(L), ok. diff --git a/src/quicer_listener_sup.erl b/src/quicer_listener_sup.erl index 0e184b06..254c52b9 100644 --- a/src/quicer_listener_sup.erl +++ b/src/quicer_listener_sup.erl @@ -51,7 +51,7 @@ start_listener(AppName, Port, Options) -> supervisor:start_child(?MODULE, chid_spec(AppName, Port, Options)). stop_listener(AppName) -> - supervisor:terminate_child(?MODULE, ?CHILD_ID(AppName)), + _ = supervisor:terminate_child(?MODULE, ?CHILD_ID(AppName)), supervisor:delete_child(?MODULE, ?CHILD_ID(AppName)). -spec listeners() -> [{{atom(), integer()|string()}, pid()}]. diff --git a/src/quicer_server_conn_callback.erl b/src/quicer_server_conn_callback.erl index 62d0abfd..3de88412 100644 --- a/src/quicer_server_conn_callback.erl +++ b/src/quicer_server_conn_callback.erl @@ -111,7 +111,7 @@ peer_needs_streams(_C, _UnidiOrBidi, S) -> connected(Conn, _Flags, #{ slow_start := false, stream_opts := SOpts , stream_callback := Callback} = S) -> %% @TODO configurable behavior of spawing stream acceptor - quicer_stream:start_link(Callback, Conn, SOpts), + _ = quicer_stream:start_link(Callback, Conn, SOpts), {ok, S#{conn => Conn}}; connected(_Connecion, _Flags, S) -> {ok, S}.