Fix ejabberd_auth_http start/2 that blocked ejabberd start (#211)
This commit is contained in:
		
							parent
							
								
									91b9bd9973
								
							
						
					
					
						commit
						6780874893
					
				@ -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},
 | 
					 | 
				
			||||||
                                      {cuesport, start_link,
 | 
					 | 
				
			||||||
			[pool_name(Host), PoolSize, ChildMods, ChildMFA]},
 | 
								[pool_name(Host), PoolSize, ChildMods, ChildMFA]},
 | 
				
			||||||
                                      transient, 2000, supervisor, [cuesport | ChildMods]}),
 | 
							 transient, 2000, supervisor, [cuesport | ChildMods]},
 | 
				
			||||||
    ok.
 | 
					    supervisor:start_child(ejabberd_backend_sup, ChildSpec).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-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).
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user