diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-01-25 14:58:29 +0000 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-01-25 14:58:29 +0000 |
| commit | dacd413d2c961f3ee47cdd266ae6c0796787ee6c (patch) | |
| tree | 54da0682836105102fadb940eb283507cddcb8ff | |
| parent | 5f55a91f1a5e7af2c05df56cc5834d77c7e902a8 (diff) | |
| download | rabbitmq-server-git-dacd413d2c961f3ee47cdd266ae6c0796787ee6c.tar.gz | |
Cons instead of append, reject does not change the channel state.
| -rw-r--r-- | src/rabbit_channel.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 9c8cc87570..3ebb5d75e6 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) -> |
