Fix ejabberd_auth_http start/2 that blocked ejabberd start (#211)

This commit is contained in:
Badlop 2017-08-15 12:27:45 +02:00
parent 91b9bd9973
commit 6780874893
1 changed files with 9 additions and 9 deletions

View File

@ -48,13 +48,11 @@ start(Host) ->
Opts = proplists:get_value(connection_opts, AuthOpts, []), Opts = proplists:get_value(connection_opts, AuthOpts, []),
ChildMods = [fusco], ChildMods = [fusco],
ChildMFA = {fusco, start_link, [binary_to_list(AuthHost), Opts]}, ChildMFA = {fusco, start_link, [binary_to_list(AuthHost), Opts]},
Proc = gen_mod:get_module_proc(Host, ?MODULE),
{ok, _} = supervisor:start_child(ejabberd_sup, ChildSpec = {Proc, {cuesport, start_link,
{{ejabberd_auth_http_sup, Host}, [pool_name(Host), PoolSize, ChildMods, ChildMFA]},
{cuesport, start_link, transient, 2000, supervisor, [cuesport | ChildMods]},
[pool_name(Host), PoolSize, ChildMods, ChildMFA]}, supervisor:start_child(ejabberd_backend_sup, ChildSpec).
transient, 2000, supervisor, [cuesport | ChildMods]}),
ok.
-spec plain_password_required(binary()) -> false. -spec plain_password_required(binary()) -> false.
plain_password_required(Server) -> plain_password_required(Server) ->
@ -277,5 +275,7 @@ login(_User, _Server) ->
get_password(_User, _Server, _DefaultValue) -> get_password(_User, _Server, _DefaultValue) ->
erlang:error(not_implemented). erlang:error(not_implemented).
stop(_Host) -> stop(Host) ->
ok. Proc = gen_mod:get_module_proc(Host, ?MODULE),
supervisor:terminate_child(ejabberd_backend_sup, Proc),
supervisor:delete_child(ejabberd_backend_sup, Proc).