feat(quic): handle stream close.

This commit is contained in:
William Yang 2021-03-31 13:45:40 +02:00
parent e67d74d7ee
commit db1d10c44b
4 changed files with 9 additions and 4 deletions

View File

@ -2080,8 +2080,8 @@ listener.wss.external.check_origins = https://localhost:8084, https://127.0.0.1:
##
## Value: IP:Port | Port
##
## Examples: 8084, 127.0.0.1:8084, ::1:8084
listener.quic.external = 4567
## Examples: 14567, 127.0.0.1:14567, ::1:14567
listener.quic.external = 14567
## The path of WebSocket MQTT endpoint
##

View File

@ -52,7 +52,7 @@
, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}
, {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1
, {getopt, "1.0.1"}
, {quicer, {git, "https://github.com/qzhuyan/quic.git", {branch, "quicer_application"}}}
, {quicer, {git, "https://github.com/qzhuyan/quic.git", {branch, "fix/getopt3-free-bin"}}}
]}.
{xref_ignores,

View File

@ -657,6 +657,9 @@ handle_info({sock_error, Reason}, State) ->
Reason =/= closed andalso ?LOG(error, "Socket error: ~p", [Reason]),
handle_info({sock_closed, Reason}, close_socket(State));
handle_info({quic, closed, _Channel, ReasonFlag}, State) ->
handle_info({sock_closed, ReasonFlag}, State);
handle_info(Info, State) ->
with_channel(handle_info, [Info], State).

View File

@ -62,7 +62,9 @@ getopts(_Socket, _Opts) ->
{buffer,80000}]}.
fast_close(Stream) ->
quicer:close_stream(Stream).
quicer:close_stream(Stream),
%% Stream might be closed already.
ok.
-spec(ensure_ok_or_exit(atom(), list(term())) -> term()).
ensure_ok_or_exit(Fun, Args = [Sock|_]) when is_atom(Fun), is_list(Args) ->