summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsylvainhubsch <sylvain.hubsch@gmail.com>2016-04-19 00:52:30 -0700
committerMichael Klishin <michael@clojurewerkz.org>2016-06-06 15:03:43 +0300
commit6853bb46b9516a9a06d764a258510659d02b5ef0 (patch)
treeff50060541c9cbc4dd6bd86492e6f7d2f0c5439b /src
parentb6db63151efffa7c091702b78aac64f84f4ffcb2 (diff)
downloadrabbitmq-server-git-6853bb46b9516a9a06d764a258510659d02b5ef0.tar.gz
Stop match earlier, and added some commentsrabbitmq_v3_6_3_milestone1
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_exchange_type_headers.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rabbit_exchange_type_headers.erl b/src/rabbit_exchange_type_headers.erl
index c9dedbbe95..444d507c7e 100644
--- a/src/rabbit_exchange_type_headers.erl
+++ b/src/rabbit_exchange_type_headers.erl
@@ -111,16 +111,26 @@ headers_match(Pattern = [{PK, _PT, _PV} | _], [{DK, _DT, _DV} | DRest],
headers_match([{PK, _PT, _PV} | PRest], Data = [{DK, _DT, _DV} | _],
_AllMatch, AnyMatch, MatchKind) when PK < DK ->
headers_match(PRest, Data, false, AnyMatch, MatchKind);
+
+%% It's not properly specified, but a "no value" in a
+%% pattern field is supposed to mean simple presence of
+%% the corresponding data field. I've interpreted that to
+%% mean a type of "void" for the pattern field.
headers_match([{PK, void, _PV} | PRest], [{DK, _DT, _DV} | DRest],
AllMatch, _AnyMatch, MatchKind) when PK == DK ->
headers_match(PRest, DRest, AllMatch, true, MatchKind);
+
+% Complete match, true with any, go next
headers_match([{PK, _PT, PV} | PRest], [{DK, _DT, DV} | DRest],
AllMatch, _AnyMatch, MatchKind) when PK == DK andalso PV == DV ->
headers_match(PRest, DRest, AllMatch, true, MatchKind);
+
+% Value does not match, false with all, go next
headers_match([{PK, _PT, _PV} | PRest], [{DK, _DT, _DV} | DRest],
_AllMatch, AnyMatch, MatchKind) when PK == DK ->
headers_match(PRest, DRest, false, AnyMatch, MatchKind).
+
validate(_X) -> ok.
create(_Tx, _X) -> ok.
delete(_Tx, _X, _Bs) -> ok.