feat(quic): handle stream close.
This commit is contained in:
parent
e67d74d7ee
commit
db1d10c44b
|
@ -2080,8 +2080,8 @@ listener.wss.external.check_origins = https://localhost:8084, https://127.0.0.1:
|
||||||
##
|
##
|
||||||
## Value: IP:Port | Port
|
## Value: IP:Port | Port
|
||||||
##
|
##
|
||||||
## Examples: 8084, 127.0.0.1:8084, ::1:8084
|
## Examples: 14567, 127.0.0.1:14567, ::1:14567
|
||||||
listener.quic.external = 4567
|
listener.quic.external = 14567
|
||||||
|
|
||||||
## The path of WebSocket MQTT endpoint
|
## The path of WebSocket MQTT endpoint
|
||||||
##
|
##
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}
|
, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}
|
||||||
, {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1
|
, {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1
|
||||||
, {getopt, "1.0.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,
|
{xref_ignores,
|
||||||
|
|
|
@ -657,6 +657,9 @@ handle_info({sock_error, Reason}, State) ->
|
||||||
Reason =/= closed andalso ?LOG(error, "Socket error: ~p", [Reason]),
|
Reason =/= closed andalso ?LOG(error, "Socket error: ~p", [Reason]),
|
||||||
handle_info({sock_closed, Reason}, close_socket(State));
|
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) ->
|
handle_info(Info, State) ->
|
||||||
with_channel(handle_info, [Info], State).
|
with_channel(handle_info, [Info], State).
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,9 @@ getopts(_Socket, _Opts) ->
|
||||||
{buffer,80000}]}.
|
{buffer,80000}]}.
|
||||||
|
|
||||||
fast_close(Stream) ->
|
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()).
|
-spec(ensure_ok_or_exit(atom(), list(term())) -> term()).
|
||||||
ensure_ok_or_exit(Fun, Args = [Sock|_]) when is_atom(Fun), is_list(Args) ->
|
ensure_ok_or_exit(Fun, Args = [Sock|_]) when is_atom(Fun), is_list(Args) ->
|
||||||
|
|
Loading…
Reference in New Issue