diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2015-03-13 13:22:35 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2015-03-13 13:22:35 +0000 |
| commit | 2699e48167d852af5c4eb8cbb49381ba6e49748f (patch) | |
| tree | a1b02575b95a17afe1d28067e028bd1902b0d5ac /src | |
| parent | be901c15d817f4e31b5563ca582e6ff6b39c78e7 (diff) | |
| download | rabbitmq-server-git-2699e48167d852af5c4eb8cbb49381ba6e49748f.tar.gz | |
Make sure we have the properties before trying to use them. References #65.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_priority_queue.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rabbit_priority_queue.erl b/src/rabbit_priority_queue.erl index 30e7c051fe..e20e4b4c14 100644 --- a/src/rabbit_priority_queue.erl +++ b/src/rabbit_priority_queue.erl @@ -533,9 +533,12 @@ a(State = #state{bqss = BQSs}) -> priority(P, BQSs) when is_integer(P) -> {P, bq_fetch(P, BQSs)}; -priority(_Msg, [{P, BQSN}]) -> +priority(#basic_message{content = Content}, BQSs) -> + priority1(rabbit_binary_parser:ensure_content_decoded(Content), BQSs). + +priority1(_Content, [{P, BQSN}]) -> {P, BQSN}; -priority(Msg = #basic_message{content = #content{properties = Props}}, +priority1(Content = #content{properties = Props}, [{P, BQSN} | Rest]) -> #'P_basic'{priority = Priority0} = Props, Priority = case Priority0 of @@ -544,7 +547,7 @@ priority(Msg = #basic_message{content = #content{properties = Props}}, end, case Priority >= P of true -> {P, BQSN}; - false -> priority(Msg, Rest) + false -> priority1(Content, Rest) end. add_maybe_infinity(infinity, _) -> infinity; |
