diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-02-18 13:13:49 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-02-18 13:13:49 +0000 |
commit | 9ba414dc72130ab0513a2f30ce17f442bb8f1c09 (patch) | |
tree | ea430c733ba5181103ddb68e904f745c112b6b2b | |
parent | 868079c6b8d99e86e9419427b97997a1fa256585 (diff) | |
download | rabbitmq-server-9ba414dc72130ab0513a2f30ce17f442bb8f1c09.tar.gz |
Only ever return 'flow' if there are no alarms. I think in theory it's not possible for there to be an alarm when in flow control, but this is more correct and no less clear.
-rw-r--r-- | src/rabbit_reader.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index b1d0e275..60e026a4 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -1077,11 +1077,10 @@ i(state, #v1{connection_state = ConnectionState, last_blocked_by = WasBlockedBy, last_blocked_at = T}}) -> Recently = T =/= never andalso timer:now_diff(erlang:now(), T) < 5000000, - case {credit_flow:blocked() andalso Alarms =:= [], - WasBlockedBy, Recently} of - {true, _, _} -> flow; - {false, flow, true} -> flow; - {_, _, _} -> ConnectionState + case {credit_flow:blocked(), WasBlockedBy, Alarms, Recently} of + {true, _, [], _} -> flow; + {_, flow, [], true} -> flow; + {_, _, _, _} -> ConnectionState end; i(Item, #v1{connection = Conn}) -> ic(Item, Conn). |