feat(quic): handle stream close.

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

View File

@ -2164,8 +2164,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

@ -738,6 +738,9 @@ handle_info({sock_error, Reason}, State) ->
end,
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) ->

View File

@ -54,7 +54,7 @@
, {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.13.0"}}}
, {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.5.1"}}}
, {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.2.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,