fix(quic): dialyzer errors

This commit is contained in:
William Yang 2021-06-30 11:21:07 +02:00 committed by turtleDeng
parent 72117f3f1d
commit 5ae8cd2fa3
1 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,11 @@ getstat(Socket, Stats) ->
end.
setopts(Socket, Opts) ->
[ quicer:setopt(Socket, Opt, V) || {Opt, V} <- Opts ],
lists:foreach(fun({Opt, V}) when is_atom(Opt) ->
quicer:setopt(Socket, Opt, V);
(Opt) when is_atom(Opt) ->
quicer:setopt(Socket, Opt, true)
end, Opts),
ok.
getopts(_Socket, _Opts) ->
@ -65,8 +69,8 @@ getopts(_Socket, _Opts) ->
{buffer,80000}]}.
fast_close(Stream) ->
quicer:async_close_stream(Stream),
%% Stream might be closed already.
_ = quicer:async_close_stream(Stream),
ok.
-spec(ensure_ok_or_exit(atom(), list(term())) -> term()).