diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2013-11-02 10:30:19 +1000 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2013-11-02 10:30:19 +1000 |
commit | c0240e7249a2ba1f503c88581bce1edb3cad12e0 (patch) | |
tree | 1047912668718aedc18ecf5c5a9501b24015a904 | |
parent | Avoid case clause crash when loading permanent rooms (diff) |
Do not try to start STUN application during config checks
-rw-r--r-- | src/ejabberd_listener.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ejabberd_listener.erl b/src/ejabberd_listener.erl index 033eb0e0f..5dc26c68e 100644 --- a/src/ejabberd_listener.erl +++ b/src/ejabberd_listener.erl @@ -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. |