diff --git a/apps/emqx/etc/emqx.conf b/apps/emqx/etc/emqx.conf index 6be808264..19100c41e 100644 --- a/apps/emqx/etc/emqx.conf +++ b/apps/emqx/etc/emqx.conf @@ -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 ## diff --git a/apps/emqx/src/emqx_connection.erl b/apps/emqx/src/emqx_connection.erl index 6900e4f1e..8e3ee400b 100644 --- a/apps/emqx/src/emqx_connection.erl +++ b/apps/emqx/src/emqx_connection.erl @@ -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). diff --git a/apps/emqx/src/emqx_quic_stream.erl b/apps/emqx/src/emqx_quic_stream.erl index e12d95f30..a80af643a 100644 --- a/apps/emqx/src/emqx_quic_stream.erl +++ b/apps/emqx/src/emqx_quic_stream.erl @@ -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) -> diff --git a/rebar.config b/rebar.config index eaa0ea6cf..ac0604728 100644 --- a/rebar.config +++ b/rebar.config @@ -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,