diff options
| author | Marcel Waldvogel <marcel.waldvogel@uni-konstanz.de> | 2018-07-30 22:49:18 +0200 |
|---|---|---|
| committer | Marcel Waldvogel <marcel.waldvogel@uni-konstanz.de> | 2018-07-30 22:49:18 +0200 |
| commit | 9b48dc9cc3ea35e2b8c8544a2cf4563d13b51898 (patch) | |
| tree | ff47184557621be8f612ad6215c741e50266cec1 /src | |
| parent | New option tombstone_expiry locks recent room creation after destroy (#2546) (diff) | |
Make it possible to join extauth pools
Diffstat (limited to 'src')
| -rw-r--r-- | src/ejabberd_auth_external.erl | 4 | ||||
| -rw-r--r-- | src/extauth.erl | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/ejabberd_auth_external.erl b/src/ejabberd_auth_external.erl index 0a1515d34..3e300e3a0 100644 --- a/src/ejabberd_auth_external.erl +++ b/src/ejabberd_auth_external.erl @@ -118,9 +118,11 @@ opt_type(extauth_instances) -> fun (V) when is_integer(V), V > 0 -> V end; opt_type(extauth_program) -> 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) -> fun(I) when is_integer(I), I>0 -> I end; opt_type(_) -> - [extauth_program, extauth_pool_size, + [extauth_program, extauth_pool_size, extauth_pool_name, %% Deprecated: extauth_cache, extauth_instances]. diff --git a/src/extauth.erl b/src/extauth.erl index 7a71cfbc9..f77d3d2cc 100644 --- a/src/extauth.erl +++ b/src/extauth.erl @@ -82,7 +82,12 @@ prog_name(Host) -> -spec pool_name(binary()) -> atom(). 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(). worker_name(Pool, N) -> |
