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

Do not start mod_proxy65 if it is unable to bind an address (EJAB-1336)

This commit is contained in:
Evgeniy Khramtsov 2010-11-17 18:13:19 +09:00
parent 78931d8efa
commit a0e2e943b4

View File

@ -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),