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 | 5b501ee3fe26a12855a2d9f1b42ae4a8f65bd69d (patch) | |
| tree | ea430c733ba5181103ddb68e904f745c112b6b2b | |
| parent | 630307a8437b3a5972e0d50e66dbcb55a59004b7 (diff) | |
| download | rabbitmq-server-git-5b501ee3fe26a12855a2d9f1b42ae4a8f65bd69d.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 b1d0e2759e..60e026a468 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). |
