summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-06-03 16:20:54 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-06-03 16:20:54 +0100
commit0b893c218806260fb1acffde2cfef977545cc771 (patch)
tree149679f5a9a43b97438e447d5817dcc64777dbec
parentdef14a9e7ccc6a6a93be1a7b8dc4835766f452c5 (diff)
downloadrabbitmq-server-0b893c218806260fb1acffde2cfef977545cc771.tar.gz
Oh, the shame. Changeset 54ad947f3b9e happened after I'd been playing with Wrangler - and I accidentally committed some random refactorings. So at least we know Wrangler is correctness-preserving. Still, I feel rather stupid.
-rw-r--r--src/rabbit_channel.erl16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index eb9ed4ed..74f9cacf 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -187,7 +187,7 @@ force_event_refresh(Ref) ->
%%---------------------------------------------------------------------------
-init([Channel, Foo, WriterPid, ConnPid, ConnName, Protocol, User, VHost,
+init([Channel, ReaderPid, WriterPid, ConnPid, ConnName, Protocol, User, VHost,
Capabilities, CollectorPid, LimiterPid]) ->
process_flag(trap_exit, true),
?store_proc_name({ConnName, Channel}),
@@ -195,7 +195,7 @@ init([Channel, Foo, WriterPid, ConnPid, ConnName, Protocol, User, VHost,
State = #ch{state = starting,
protocol = Protocol,
channel = Channel,
- reader_pid = Foo,
+ reader_pid = ReaderPid,
writer_pid = WriterPid,
conn_pid = ConnPid,
conn_name = ConnName,
@@ -894,7 +894,8 @@ handle_method(#'exchange.declare'{exchange = ExchangeNameBin,
_, State = #ch{virtual_host = VHostPath}) ->
CheckedType = rabbit_exchange:check_type(TypeNameBin),
ExchangeName = rabbit_misc:r(VHostPath, exchange, ExchangeNameBin),
- test(State, ExchangeName),
+ check_not_default_exchange(ExchangeName),
+ check_configure_permitted(ExchangeName, State),
X = case rabbit_exchange:lookup(ExchangeName) of
{ok, FoundX} -> FoundX;
{error, not_found} ->
@@ -1118,7 +1119,7 @@ handle_method(#'tx.commit'{}, _, #ch{tx = none}) ->
handle_method(#'tx.commit'{}, _, State = #ch{tx = {Msgs, Acks},
limiter = Limiter}) ->
- State1 = test2(State, Msgs),
+ State1 = rabbit_misc:queue_fold(fun deliver_to_queues/2, State, Msgs),
Rev = fun (X) -> lists:reverse(lists:sort(X)) end,
lists:foreach(fun ({ack, A}) -> ack(Rev(A), State1);
({Requeue, A}) -> reject(Requeue, Rev(A), Limiter)
@@ -1164,13 +1165,6 @@ handle_method(_MethodRecord, _Content, _State) ->
rabbit_misc:protocol_error(
command_invalid, "unimplemented method", []).
-test2(State, Msgs) ->
- rabbit_misc:queue_fold(fun deliver_to_queues/2, State, Msgs).
-
-test(State, ExchangeName) ->
- check_not_default_exchange(ExchangeName),
- check_configure_permitted(ExchangeName, State).
-
%%----------------------------------------------------------------------------
%% We get the queue process to send the consume_ok on our behalf. This