mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Do not start mod_proxy65 if it is unable to bind an address (EJAB-1336)
This commit is contained in:
parent
78931d8efa
commit
a0e2e943b4
@ -42,13 +42,17 @@
|
||||
-define(PROCNAME, ejabberd_mod_proxy65).
|
||||
|
||||
start(Host, Opts) ->
|
||||
mod_proxy65_service:add_listener(Host, Opts),
|
||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
||||
ChildSpec = {
|
||||
Proc, {?MODULE, start_link, [Host, Opts]},
|
||||
transient, infinity, supervisor, [?MODULE]
|
||||
},
|
||||
supervisor:start_child(ejabberd_sup, ChildSpec).
|
||||
case mod_proxy65_service:add_listener(Host, Opts) of
|
||||
{error, _} = Err ->
|
||||
erlang:error(Err);
|
||||
_ ->
|
||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
||||
ChildSpec = {
|
||||
Proc, {?MODULE, start_link, [Host, Opts]},
|
||||
transient, infinity, supervisor, [?MODULE]
|
||||
},
|
||||
supervisor:start_child(ejabberd_sup, ChildSpec)
|
||||
end.
|
||||
|
||||
stop(Host) ->
|
||||
mod_proxy65_service:delete_listener(Host),
|
||||
|
Loading…
Reference in New Issue
Block a user