fix(quic): return empty list for dead 'Socket'

This commit is contained in:
William Yang 2021-04-03 11:22:47 +02:00
parent 087aa1dd53
commit 570e096b56
1 changed files with 4 additions and 2 deletions

View File

@ -47,8 +47,10 @@ peercert(_S) ->
nossl.
getstat(Socket, Stats) ->
Res = quicer:getstats(Socket, Stats),
{ok, lists:keyreplace(send_pend, 1, Res, {send_pend, 0})}.
case quicer:getstats(Socket, Stats) of
{error, _} -> [];
Res -> {ok, Res}
end.
setopts(_Socket, _Opts) ->
ok.