summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2010-06-08 17:50:03 +0100
committerSimon MacMullen <simon@rabbitmq.com>2010-06-08 17:50:03 +0100
commitef1c69b3585e95b87d7f63185729910319ba732c (patch)
treeccd89525ef35378e5b922a20db2a29055ed3ac4c
parent6f0c1c01e078b134db75dde900e28def217908d3 (diff)
downloadrabbitmq-server-ef1c69b3585e95b87d7f63185729910319ba732c.tar.gz
Prevent the same delivery tag being used more than once.
Note that we change from command_invalid to not_found as the former is a connection error, and the latter a channel error. Both 0-8 and 0-9-1 specify a channel error.
-rw-r--r--src/rabbit_channel.erl8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index f355bef3..035ce89e 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -465,11 +465,6 @@ handle_method(#'basic.ack'{delivery_tag = DeliveryTag,
_, State = #ch{transaction_id = TxnKey,
next_tag = NextDeliveryTag,
unacked_message_q = UAMQ}) ->
- if DeliveryTag >= NextDeliveryTag ->
- rabbit_misc:protocol_error(
- command_invalid, "unknown delivery tag ~w", [DeliveryTag]);
- true -> ok
- end,
{Acked, Remaining} = collect_acks(UAMQ, DeliveryTag, Multiple),
Participants = ack(TxnKey, Acked),
{noreply, case TxnKey of
@@ -968,7 +963,8 @@ collect_acks(ToAcc, PrefixAcc, Q, DeliveryTag, Multiple) ->
QTail, DeliveryTag, Multiple)
end;
{empty, _} ->
- {ToAcc, PrefixAcc}
+ rabbit_misc:protocol_error(
+ not_found, "unknown delivery tag ~w", [DeliveryTag])
end.
add_tx_participants(MoreP, State = #ch{tx_participants = Participants}) ->