fix: quic listener spec

This commit is contained in:
William Yang 2021-08-25 17:04:04 +02:00
parent 2ef2acc850
commit eb7625a595
2 changed files with 5 additions and 7 deletions

View File

@ -135,7 +135,9 @@
, system_code_change/4
]}).
-spec(start_link(esockd:transport(), esockd:socket(), emqx_channel:opts())
-spec(start_link(esockd:transport(),
esockd:socket() | {pid(), quicer:connection_handler()},
emqx_channel:opts())
-> {ok, pid()}).
start_link(Transport, Socket, Options) ->
Args = [self(), Transport, Socket, Options],

View File

@ -50,12 +50,8 @@ new_conn(Conn, S) ->
-spec connected(quicer:connection_handler(), cb_state()) -> {ok, cb_state()} | {error, any()}.
connected(Conn, #{slow_start := false} = S) ->
case emqx_connection:start_link(emqx_quic_stream, Conn, S) of
{ok, _Pid} ->
{ok, S};
Other ->
{error, Other}
end;
{ok, _Pid} = emqx_connection:start_link(emqx_quic_stream, Conn, S),
{ok, S};
connected(_Conn, S) ->
{ok, S}.