25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +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 0b8a761a61
commit ec0e0ef8a6

View File

@ -42,13 +42,17 @@
-define(PROCNAME, ejabberd_mod_proxy65). -define(PROCNAME, ejabberd_mod_proxy65).
start(Host, Opts) -> start(Host, Opts) ->
mod_proxy65_service:add_listener(Host, Opts), case mod_proxy65_service:add_listener(Host, Opts) of
Proc = gen_mod:get_module_proc(Host, ?PROCNAME), {error, _} = Err ->
ChildSpec = { erlang:error(Err);
Proc, {?MODULE, start_link, [Host, Opts]}, _ ->
transient, infinity, supervisor, [?MODULE] Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
}, ChildSpec = {
supervisor:start_child(ejabberd_sup, ChildSpec). Proc, {?MODULE, start_link, [Host, Opts]},
transient, infinity, supervisor, [?MODULE]
},
supervisor:start_child(ejabberd_sup, ChildSpec)
end.
stop(Host) -> stop(Host) ->
mod_proxy65_service:delete_listener(Host), mod_proxy65_service:delete_listener(Host),