feat(quic): reload quicer lib before start listener

This commit is contained in:
William Yang 2021-05-08 23:31:29 +02:00
parent 14057c033d
commit e062be2b0e
3 changed files with 4 additions and 3 deletions

View File

@ -49,9 +49,6 @@ start(_Type, _Args) ->
ok = emqx_plugins:init(),
_ = emqx_plugins:load(),
_ = start_ce_modules(),
%% @fixme unsure why we need this.
quicer_nif:open_lib(),
quicer_nif:reg_open(),
emqx_boot:is_enabled(listeners) andalso (ok = emqx_listeners:start()),
register(emqx, self()),
ok = emqx_alarm_handler:load(),

View File

@ -143,6 +143,9 @@ start_listener(Proto, ListenOn, Options) when Proto == https; Proto == wss ->
%% Start MQTT/QUIC listener
start_listener(quic, ListenOn, Options) ->
%% @fixme unsure why we need reopen lib and reopen config.
quicer_nif:open_lib(),
quicer_nif:reg_open(),
SSLOpts = proplists:get_value(ssl_options, Options),
ListenOpts = [ {cert, proplists:get_value(certfile, SSLOpts)}
, {key, proplists:get_value(keyfile, SSLOpts)}

View File

@ -28,6 +28,7 @@ all() -> emqx_ct:all(?MODULE).
init_per_suite(Config) ->
NewConfig = generate_config(),
application:ensure_all_started(esockd),
application:ensure_all_started(quicer),
application:ensure_all_started(cowboy),
lists:foreach(fun set_app_env/1, NewConfig),
Config.