summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-01-25 14:58:29 +0000
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-01-25 14:58:29 +0000
commita9e04d64523ae8ada19b88f8b9ef55974f1306af (patch)
tree54da0682836105102fadb940eb283507cddcb8ff
parent6747406f83dfa6ff8c461d529424356dc4e70fd9 (diff)
downloadrabbitmq-server-a9e04d64523ae8ada19b88f8b9ef55974f1306af.tar.gz
Cons instead of append, reject does not change the channel state.
-rw-r--r--src/rabbit_channel.erl11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 9c8cc875..3ebb5d75 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1077,11 +1077,10 @@ handle_method(#'tx.commit'{}, _, State = #ch{uncommitted_message_q = TMQ,
limiter = Limiter}) ->
State1 = rabbit_misc:queue_fold(fun deliver_to_queues/2, State, TMQ),
State2 = ack(TAL, State1),
- State3 = lists:foldl(
- fun ({Requeue, Acked}, S) -> reject(Requeue, Acked, Limiter) end,
- State2, TNL),
- State4 = new_tx(State3),
- {noreply, maybe_complete_tx(State4#ch{tx_status = committing})};
+ lists:foreach(
+ fun({Requeue, Acked}) -> reject(Requeue, Acked, Limiter) end, TNL),
+ State3 = new_tx(State2),
+ {noreply, maybe_complete_tx(State3#ch{tx_status = committing})};
handle_method(#'tx.rollback'{}, _, #ch{tx_status = none}) ->
rabbit_misc:protocol_error(
@@ -1288,7 +1287,7 @@ reject_tx(DeliveryTag, Multiple, Requeue,
State1;
in_progress ->
State1#ch{uncommitted_nacks =
- {Requeue, Acked} ++ State1#ch.uncommitted_nacks}
+ [{Requeue, Acked} | State1#ch.uncommitted_nacks]}
end}.
reject(Requeue, Acked, Limiter) ->