From b0189fa28f4ca6989e20658ac5276038b8baa7ed Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Tue, 12 Aug 2014 14:46:51 +0100 Subject: Rename --- src/rabbit_amqqueue.erl | 2 +- src/rabbit_amqqueue_process.erl | 2 +- src/rabbit_policies.erl | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 29ce3f03..a33a8fcc 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -462,7 +462,7 @@ declare_args() -> {<<"x-message-ttl">>, fun check_message_ttl_arg/2}, {<<"x-dead-letter-routing-key">>, fun check_dlxrk_arg/2}, {<<"x-max-length">>, fun check_non_neg_int_arg/2}, - {<<"x-max-bytes">>, fun check_non_neg_int_arg/2}]. + {<<"x-max-length-bytes">>, fun check_non_neg_int_arg/2}]. consume_args() -> [{<<"x-priority">>, fun check_int_arg/2}, {<<"x-cancel-on-ha-failover">>, fun check_bool_arg/2}]. diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index d3c06286..db297c1d 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -267,7 +267,7 @@ process_args_policy(State = #q{q = Q, {<<"dead-letter-routing-key">>, fun res_arg/2, fun init_dlx_rkey/2}, {<<"message-ttl">>, fun res_min/2, fun init_ttl/2}, {<<"max-length">>, fun res_min/2, fun init_max_length/2}, - {<<"max-bytes">>, fun res_min/2, fun init_max_bytes/2}], + {<<"max-length-bytes">>, fun res_min/2, fun init_max_bytes/2}], drop_expired_msgs( lists:foldl(fun({Name, Resolve, Fun}, StateN) -> Fun(args_policy_lookup(Name, Resolve, Q), StateN) diff --git a/src/rabbit_policies.erl b/src/rabbit_policies.erl index 6903c42e..cc88765f 100644 --- a/src/rabbit_policies.erl +++ b/src/rabbit_policies.erl @@ -35,7 +35,7 @@ register() -> {policy_validator, <<"message-ttl">>}, {policy_validator, <<"expires">>}, {policy_validator, <<"max-length">>}, - {policy_validator, <<"max-bytes">>}]], + {policy_validator, <<"max-length-bytes">>}]], ok. validate_policy(Terms) -> @@ -79,9 +79,8 @@ validate_policy0(<<"max-length">>, Value) validate_policy0(<<"max-length">>, Value) -> {error, "~p is not a valid maximum length", [Value]}; -validate_policy0(<<"max-bytes">>, Value) +validate_policy0(<<"max-length-bytes">>, Value) when is_integer(Value), Value >= 0 -> ok; -validate_policy0(<<"max-bytes">>, Value) -> - {error, "~p is not a valid maximum number of bytes", [Value]}. - +validate_policy0(<<"max-length-bytes">>, Value) -> + {error, "~p is not a valid maximum length in bytes", [Value]}. -- cgit v1.2.1