summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2016-05-17 15:29:28 +0300
committerMichael Klishin <michael@clojurewerkz.org>2016-05-17 15:29:28 +0300
commit4eca125d7db41422125e304699dc63a550811293 (patch)
tree252980e32f2ca599225ba788b99d077552e1108d /src
parent4a2b17f6d9b3a7aca95caf8cb22e5bef9e61fe1c (diff)
parent8981049b7b9b463e4056c5c9352014a0393f88ff (diff)
downloadrabbitmq-server-git-4eca125d7db41422125e304699dc63a550811293.tar.gz
Merge branch 'master' into rabbitmq-server-546
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_binding.erl4
-rw-r--r--src/rabbit_policy.erl4
-rw-r--r--src/rabbit_priority_queue.erl3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index 299e254c50..8904c1dd74 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -100,7 +100,8 @@
-define(INFO_KEYS, [source_name, source_kind,
destination_name, destination_kind,
- routing_key, arguments]).
+ routing_key, arguments,
+ vhost]).
recover(XNames, QNames) ->
rabbit_misc:table_filter(
@@ -272,6 +273,7 @@ infos(Items, B) -> [{Item, i(Item, B)} || Item <- Items].
i(source_name, #binding{source = SrcName}) -> SrcName#resource.name;
i(source_kind, #binding{source = SrcName}) -> SrcName#resource.kind;
+i(vhost, #binding{source = SrcName}) -> SrcName#resource.virtual_host;
i(destination_name, #binding{destination = DstName}) -> DstName#resource.name;
i(destination_kind, #binding{destination = DstName}) -> DstName#resource.kind;
i(routing_key, #binding{key = RoutingKey}) -> RoutingKey;
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl
index d04551043e..eb8cf63327 100644
--- a/src/rabbit_policy.erl
+++ b/src/rabbit_policy.erl
@@ -221,11 +221,11 @@ validate(_VHost, <<"policy">>, Name, Term, _User) ->
Name, policy_validation(), Term).
notify(VHost, <<"policy">>, Name, Term) ->
- rabbit_event:notify(policy_set, [{name, Name} | Term]),
+ rabbit_event:notify(policy_set, [{name, Name}, {vhost, VHost} | Term]),
update_policies(VHost).
notify_clear(VHost, <<"policy">>, Name) ->
- rabbit_event:notify(policy_cleared, [{name, Name}]),
+ rabbit_event:notify(policy_cleared, [{name, Name}, {vhost, VHost}]),
update_policies(VHost).
%%----------------------------------------------------------------------------
diff --git a/src/rabbit_priority_queue.erl b/src/rabbit_priority_queue.erl
index b58a8c535e..6141796f7b 100644
--- a/src/rabbit_priority_queue.erl
+++ b/src/rabbit_priority_queue.erl
@@ -563,8 +563,9 @@ findfold3(Fun, Acc, NotFound, [{P, BQSN} | Rest], BQSAcc) ->
findfold3(_Fun, Acc, NotFound, [], BQSAcc) ->
{NotFound, Acc, lists:reverse(BQSAcc)}.
-bq_fetch(P, []) -> exit({not_found, P});
+bq_fetch(P, []) -> exit({not_found, P});
bq_fetch(P, [{P, BQSN} | _]) -> BQSN;
+bq_fetch(P, [{P1, BQSN} | _]) when P > P1 -> BQSN;
bq_fetch(P, [{_, _BQSN} | T]) -> bq_fetch(P, T).
bq_store(P, BQS, BQSs) ->