diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-25 12:05:08 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-25 12:05:08 +0100 |
commit | 0e0bcf22aad825811ccb7b633bfcfa134dde3d0e (patch) | |
tree | a9aaf862fc2bae2cc95192f2d89642d8e2fdd58e /src | |
parent | 483c7234c1bfc1e37dd5f30d91dc09d60c181238 (diff) | |
download | rabbitmq-server-0e0bcf22aad825811ccb7b633bfcfa134dde3d0e.tar.gz |
Enforce checking of x-mirror arg
Diffstat (limited to 'src')
-rw-r--r-- | src/rabbit_amqqueue.erl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 8c374ef3..50f5a9da 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -312,7 +312,8 @@ check_declare_arguments(QueueName, Args) -> [Key, rabbit_misc:rs(QueueName), Error]) end || {Key, Fun} <- [{<<"x-expires">>, fun check_integer_argument/1}, - {<<"x-message-ttl">>, fun check_integer_argument/1}]], + {<<"x-message-ttl">>, fun check_integer_argument/1}, + {<<"x-mirror">>, fun check_array_of_longstr_argument/1}]], ok. check_integer_argument(undefined) -> @@ -325,6 +326,18 @@ check_integer_argument({Type, Val}) when Val > 0 -> check_integer_argument({_Type, Val}) -> {error, {value_zero_or_less, Val}}. +check_array_of_longstr_argument(undefined) -> + ok; +check_array_of_longstr_argument({array, Array}) -> + case lists:all(fun ({longstr, _NodeName}) -> true; + (_) -> false + end, Array) of + true -> ok; + false -> {error, {array_contains_non_longstrs, Array}} + end; +check_array_of_longstr_argument({Type, _Val}) -> + {error, {unacceptable_type, Type}}. + list(VHostPath) -> mnesia:dirty_match_object( rabbit_queue, |