25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

Do not try to start STUN application during config checks

This commit is contained in:
Evgeniy Khramtsov 2013-11-02 10:30:19 +10:00
parent 6dd31299cf
commit c0240e7249

View File

@ -341,6 +341,7 @@ start_listener2(Port, Module, Opts) ->
%% It is only required to start the supervisor in some cases.
%% But it doesn't hurt to attempt to start it for any listener.
%% So, it's normal (and harmless) that in most cases this call returns: {error, {already_started, pid()}}
maybe_start_stun(Module),
start_module_sup(Port, Module),
start_listener_sup(Port, Module, Opts).
@ -455,6 +456,12 @@ is_frontend(_) -> false.
strip_frontend({frontend, Module}) -> Module;
strip_frontend(Module) when is_atom(Module) -> Module.
-spec maybe_start_stun(module()) -> any().
maybe_start_stun(ejabberd_stun) ->
ejabberd:start_app(p1_stun);
maybe_start_stun(_) ->
ok.
%%%
%%% Check options
@ -636,7 +643,6 @@ prepare_ip(IP) when is_binary(IP) ->
prepare_mod(ejabberd_stun) ->
prepare_mod(stun);
prepare_mod(stun) ->
ejabberd:start_app(p1_stun),
stun;
prepare_mod(Mod) when is_atom(Mod) ->
Mod.