diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2014-01-08 12:34:04 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2014-01-08 12:34:04 +0000 |
commit | 0b60c084311af4047809adf24e156ff71b0f544a (patch) | |
tree | b8be1878a9011ceb118cb91fe616fb49c7c1ebed | |
parent | 1fa503c3766865a705df57cf1e27adb5ec84846f (diff) | |
parent | e8ba17903ef1f71a8701a485c97b8dfe49b1d2d7 (diff) | |
download | rabbitmq-server-bug25948.tar.gz |
merge default into bug25948bug25948
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 2 | ||||
-rw-r--r-- | src/rabbit_binary_generator.erl | 22 | ||||
-rw-r--r-- | src/rabbit_queue_decorator.erl | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index dec5d50b..6391ebe6 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -222,7 +222,7 @@ notify_decorators(State = #q{consumers = Consumers, backing_queue = BQ, backing_queue_state = BQS}) -> P = rabbit_queue_consumers:max_active_priority(Consumers), - decorator_callback(qname(State), active_consumers_changed, + decorator_callback(qname(State), consumer_state_changed, [P, BQ:is_empty(BQS)]). decorator_callback(QName, F, A) -> diff --git a/src/rabbit_binary_generator.erl b/src/rabbit_binary_generator.erl index 8eaac10d..83f68ed3 100644 --- a/src/rabbit_binary_generator.erl +++ b/src/rabbit_binary_generator.erl @@ -120,18 +120,18 @@ table_field_to_binary({FName, T, V}) -> [short_string_to_binary(FName) | field_value_to_binary(T, V)]. field_value_to_binary(longstr, V) -> [$S | long_string_to_binary(V)]; -field_value_to_binary(signedint, V) -> [$I | <<V:32/signed>>]; +field_value_to_binary(signedint, V) -> [$I, <<V:32/signed>>]; field_value_to_binary(decimal, V) -> {Before, After} = V, - [$D | [Before, <<After:32>>]]; -field_value_to_binary(timestamp, V) -> [$T | <<V:64>>]; + [$D, Before, <<After:32>>]; +field_value_to_binary(timestamp, V) -> [$T, <<V:64>>]; field_value_to_binary(table, V) -> [$F | table_to_binary(V)]; field_value_to_binary(array, V) -> [$A | array_to_binary(V)]; -field_value_to_binary(byte, V) -> [$b | <<V:8/unsigned>>]; -field_value_to_binary(double, V) -> [$d | <<V:64/float>>]; -field_value_to_binary(float, V) -> [$f | <<V:32/float>>]; -field_value_to_binary(long, V) -> [$l | <<V:64/signed>>]; -field_value_to_binary(short, V) -> [$s | <<V:16/signed>>]; -field_value_to_binary(bool, V) -> [$t | [if V -> 1; true -> 0 end]]; +field_value_to_binary(byte, V) -> [$b, <<V:8/unsigned>>]; +field_value_to_binary(double, V) -> [$d, <<V:64/float>>]; +field_value_to_binary(float, V) -> [$f, <<V:32/float>>]; +field_value_to_binary(long, V) -> [$l, <<V:64/signed>>]; +field_value_to_binary(short, V) -> [$s, <<V:16/signed>>]; +field_value_to_binary(bool, V) -> [$t, if V -> 1; true -> 0 end]; field_value_to_binary(binary, V) -> [$x | long_string_to_binary(V)]; field_value_to_binary(void, _V) -> [$V]. @@ -154,13 +154,13 @@ generate_array_iolist(Array) -> short_string_to_binary(String) -> Len = string_length(String), - if Len < 256 -> [<<Len:8>> | String]; + if Len < 256 -> [<<Len:8>>, String]; true -> exit(content_properties_shortstr_overflow) end. long_string_to_binary(String) -> Len = string_length(String), - [<<Len:32>> | String]. + [<<Len:32>>, String]. string_length(String) when is_binary(String) -> size(String); string_length(String) -> length(String). diff --git a/src/rabbit_queue_decorator.erl b/src/rabbit_queue_decorator.erl index 994c9060..6205e2dc 100644 --- a/src/rabbit_queue_decorator.erl +++ b/src/rabbit_queue_decorator.erl @@ -18,7 +18,7 @@ -callback active_for(rabbit_types:amqqueue()) -> boolean(). %% called with Queue, MaxActivePriority, IsEmpty --callback active_consumers_changed( +-callback consumer_state_changed( rabbit_types:amqqueue(), integer(), boolean()) -> 'ok'. -else. @@ -27,7 +27,7 @@ behaviour_info(callbacks) -> [{description, 0}, {startup, 1}, {shutdown, 1}, {policy_changed, 2}, - {active_for, 1}, {active_consumers_changed, 3}]; + {active_for, 1}, {consumer_state_changed, 3}]; behaviour_info(_Other) -> undefined. |