Skip to content

Commit 7b22cb6

Browse files
author
Emile Joubert
committed
Merged bug25548 int stable
2 parents ba2fd14 + 48cf514 commit 7b22cb6

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/rabbit_amqqueue_process.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ handle_cast(wake_up, State) ->
13561356
handle_info(maybe_expire, State) ->
13571357
case is_unused(State) of
13581358
true -> stop(State);
1359-
false -> noreply(ensure_expiry_timer(State))
1359+
false -> noreply(State#q{expiry_timer_ref = undefined})
13601360
end;
13611361

13621362
handle_info(drop_expired, State) ->

src/rabbit_exchange_type_headers.erl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ validate_binding(_X, #binding{args = Args}) ->
6363
{binding_invalid,
6464
"Invalid x-match field type ~p (value ~p); "
6565
"expected longstr", [Type, Other]}};
66-
undefined -> {error,
67-
{binding_invalid, "x-match field missing", []}}
66+
undefined -> ok %% [0]
6867
end.
68+
%% [0] spec is vague on whether it can be omitted but in practice it's
69+
%% useful to allow people to do this
6970

70-
parse_x_match(<<"all">>) -> all;
71-
parse_x_match(<<"any">>) -> any.
71+
parse_x_match({longstr, <<"all">>}) -> all;
72+
parse_x_match({longstr, <<"any">>}) -> any;
73+
parse_x_match(_) -> all. %% legacy; we didn't validate
7274

7375
%% Horrendous matching algorithm. Depends for its merge-like
7476
%% (linear-time) behaviour on the lists:keysort
@@ -80,8 +82,8 @@ parse_x_match(<<"any">>) -> any.
8082
%% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8183
%%
8284
headers_match(Args, Data) ->
83-
{longstr, MK} = rabbit_misc:table_lookup(Args, <<"x-match">>),
84-
headers_match(Args, Data, true, false, parse_x_match(MK)).
85+
MK = parse_x_match(rabbit_misc:table_lookup(Args, <<"x-match">>)),
86+
headers_match(Args, Data, true, false, MK).
8587

8688
headers_match([], _Data, AllMatch, _AnyMatch, all) ->
8789
AllMatch;

0 commit comments

Comments
 (0)