summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2010-09-30 15:23:47 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2010-09-30 15:23:47 +0100
commit5a53ad8617dff59c4ebefdda303952e6e78ed7af (patch)
tree5402530a51e2dd02b12f0cadefaa72eea8b0c9f6
parent8c5314a3c98aca3bb6d0f61ac2eb85b0bf072008 (diff)
downloadrabbitmq-server-bug23323.tar.gz
refactorbug23323
-rw-r--r--src/rabbit_channel.erl15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index f10a50c2..eeee507e 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -879,15 +879,14 @@ handle_method(#'channel.flow'{active = false}, _,
undefined -> start_limiter(State);
Other -> Other
end,
+ State1 = State#ch{limiter_pid = LimiterPid1},
ok = rabbit_limiter:block(LimiterPid1),
- QPids = consumer_queues(Consumers),
- Queues = [{QPid, erlang:monitor(process, QPid)} || QPid <- QPids],
- ok = rabbit_amqqueue:flush_all(QPids, self()),
- case Queues of
- [] -> {reply, #'channel.flow_ok'{active = false},
- State#ch{limiter_pid = LimiterPid1}};
- _ -> {noreply, State#ch{limiter_pid = LimiterPid1,
- blocking = dict:from_list(Queues)}}
+ case consumer_queues(Consumers) of
+ [] -> {reply, #'channel.flow_ok'{active = false}, State1};
+ QPids -> Queues = [{QPid, erlang:monitor(process, QPid)} ||
+ QPid <- QPids],
+ ok = rabbit_amqqueue:flush_all(QPids, self()),
+ {noreply, State1#ch{blocking = dict:from_list(Queues)}}
end;
handle_method(_MethodRecord, _Content, _State) ->