mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Merge pull request #2551 from MarcelWaldvogel/configurable-extauth-pool
Make it possible to join extauth pools
This commit is contained in:
commit
b56c012407
@ -118,9 +118,11 @@ opt_type(extauth_instances) ->
|
|||||||
fun (V) when is_integer(V), V > 0 -> V end;
|
fun (V) when is_integer(V), V > 0 -> V end;
|
||||||
opt_type(extauth_program) ->
|
opt_type(extauth_program) ->
|
||||||
fun (V) -> binary_to_list(iolist_to_binary(V)) end;
|
fun (V) -> binary_to_list(iolist_to_binary(V)) end;
|
||||||
|
opt_type(extauth_pool_name) ->
|
||||||
|
fun (V) -> iolist_to_binary(V) end;
|
||||||
opt_type(extauth_pool_size) ->
|
opt_type(extauth_pool_size) ->
|
||||||
fun(I) when is_integer(I), I>0 -> I end;
|
fun(I) when is_integer(I), I>0 -> I end;
|
||||||
opt_type(_) ->
|
opt_type(_) ->
|
||||||
[extauth_program, extauth_pool_size,
|
[extauth_program, extauth_pool_size, extauth_pool_name,
|
||||||
%% Deprecated:
|
%% Deprecated:
|
||||||
extauth_cache, extauth_instances].
|
extauth_cache, extauth_instances].
|
||||||
|
@ -82,7 +82,12 @@ prog_name(Host) ->
|
|||||||
|
|
||||||
-spec pool_name(binary()) -> atom().
|
-spec pool_name(binary()) -> atom().
|
||||||
pool_name(Host) ->
|
pool_name(Host) ->
|
||||||
list_to_atom("extauth_pool_" ++ binary_to_list(Host)).
|
case ejabberd_config:get_option({extauth_pool_name, Host}) of
|
||||||
|
undefined ->
|
||||||
|
list_to_atom("extauth_pool_" ++ binary_to_list(Host));
|
||||||
|
Name ->
|
||||||
|
list_to_atom("extauth_pool_" ++ binary_to_list(Name))
|
||||||
|
end.
|
||||||
|
|
||||||
-spec worker_name(atom(), integer()) -> atom().
|
-spec worker_name(atom(), integer()) -> atom().
|
||||||
worker_name(Pool, N) ->
|
worker_name(Pool, N) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user