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
commitc47df9f4b2bc022648d2f8be727d21f3c28106ce (patch)
treeccd89525ef35378e5b922a20db2a29055ed3ac4c
parent76dacbbe97589bece750a63a8596852079cc7ac0 (diff)
downloadrabbitmq-server-git-c47df9f4b2bc022648d2f8be727d21f3c28106ce.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 f355bef314..035ce89e4b 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}) ->