aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2017-06-26 13:39:50 +0200
committerBadlop <badlop@process-one.net>2017-06-26 13:39:50 +0200
commit4ef1cdec12a56d7a1d3908d66182362d59677393 (patch)
tree6c22e917388b9d51367c02f9e26bd341efc4d06b /src
parentUse YAML syntax for limits option in mod_multicast (diff)
Write validator for mod_multicast's limits option
Diffstat (limited to 'src')
-rw-r--r--src/mod_multicast.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mod_multicast.erl b/src/mod_multicast.erl
index f27003f7d..4d3e481a7 100644
--- a/src/mod_multicast.erl
+++ b/src/mod_multicast.erl
@@ -1117,6 +1117,13 @@ depends(_Host, _Opts) ->
mod_opt_type(access) ->
fun acl:access_rules_validator/1;
mod_opt_type(host) -> fun iolist_to_binary/1;
-mod_opt_type(limits) ->
- fun (A) when is_list(A) -> A end;
-mod_opt_type(_) -> [access, host, limits].
+mod_opt_type({limits, Type}) when (Type == local) or (Type == remote) ->
+ fun(L) ->
+ lists:map(
+ fun ({message, infinite}) -> infinite;
+ ({presence, infinite}) -> infinite;
+ ({message, I}) when is_integer(I) -> I;
+ ({presence, I}) when is_integer(I) -> I
+ end, L)
+ end;
+mod_opt_type(_) -> [access, host, {limits, local}, {limits, remote}].