summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2013-05-10 12:54:31 +0100
committerEmile Joubert <emile@rabbitmq.com>2013-05-10 12:54:31 +0100
commit7b22cb674ca2cfc300445e0f60e20671137c9667 (patch)
treedde8fa5770884df1b08457455f17b9b8fc05a8d4 /src
parentba2fd1444124246d4d98d2a597894405e765ad16 (diff)
parent48cf514c121fd0adfc536709712a0bf2c4e44b09 (diff)
downloadrabbitmq-server-git-7b22cb674ca2cfc300445e0f60e20671137c9667.tar.gz
Merged bug25548 int stable
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl2
-rw-r--r--src/rabbit_exchange_type_headers.erl14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 066392f81c..d2f4a178d5 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -1356,7 +1356,7 @@ handle_cast(wake_up, State) ->
handle_info(maybe_expire, State) ->
case is_unused(State) of
true -> stop(State);
- false -> noreply(ensure_expiry_timer(State))
+ false -> noreply(State#q{expiry_timer_ref = undefined})
end;
handle_info(drop_expired, State) ->
diff --git a/src/rabbit_exchange_type_headers.erl b/src/rabbit_exchange_type_headers.erl
index cf2d314079..5b7f95feeb 100644
--- a/src/rabbit_exchange_type_headers.erl
+++ b/src/rabbit_exchange_type_headers.erl
@@ -63,12 +63,14 @@ validate_binding(_X, #binding{args = Args}) ->
{binding_invalid,
"Invalid x-match field type ~p (value ~p); "
"expected longstr", [Type, Other]}};
- undefined -> {error,
- {binding_invalid, "x-match field missing", []}}
+ undefined -> ok %% [0]
end.
+%% [0] spec is vague on whether it can be omitted but in practice it's
+%% useful to allow people to do this
-parse_x_match(<<"all">>) -> all;
-parse_x_match(<<"any">>) -> any.
+parse_x_match({longstr, <<"all">>}) -> all;
+parse_x_match({longstr, <<"any">>}) -> any;
+parse_x_match(_) -> all. %% legacy; we didn't validate
%% Horrendous matching algorithm. Depends for its merge-like
%% (linear-time) behaviour on the lists:keysort
@@ -80,8 +82,8 @@ parse_x_match(<<"any">>) -> any.
%% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%%
headers_match(Args, Data) ->
- {longstr, MK} = rabbit_misc:table_lookup(Args, <<"x-match">>),
- headers_match(Args, Data, true, false, parse_x_match(MK)).
+ MK = parse_x_match(rabbit_misc:table_lookup(Args, <<"x-match">>)),
+ headers_match(Args, Data, true, false, MK).
headers_match([], _Data, AllMatch, _AnyMatch, all) ->
AllMatch;