From e8d57bd39c4ae5c0bce4d8303dfbb1a8f3324493 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Fri, 18 Jun 2010 13:19:43 +0100 Subject: Permit basic.recover on a transactional channel. --- src/rabbit_channel.erl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index b087aac6..6caacc82 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -609,8 +609,7 @@ handle_method(#'basic.qos'{prefetch_count = PrefetchCount}, {reply, #'basic.qos_ok'{}, State#ch{limiter_pid = LimiterPid2}}; handle_method(#'basic.recover_async'{requeue = true}, - _, State = #ch{ transaction_id = none, - unacked_message_q = UAMQ }) -> + _, State = #ch{ unacked_message_q = UAMQ }) -> ok = fold_per_queue( fun (QPid, MsgIds, ok) -> %% The Qpid python test suite incorrectly assumes @@ -625,8 +624,7 @@ handle_method(#'basic.recover_async'{requeue = true}, {noreply, State#ch{unacked_message_q = queue:new()}}; handle_method(#'basic.recover_async'{requeue = false}, - _, State = #ch{ transaction_id = none, - writer_pid = WriterPid, + _, State = #ch{ writer_pid = WriterPid, unacked_message_q = UAMQ }) -> ok = rabbit_misc:queue_fold( fun ({_DeliveryTag, none, _Msg}, ok) -> @@ -650,9 +648,6 @@ handle_method(#'basic.recover_async'{requeue = false}, %% variant of this method {noreply, State}; -handle_method(#'basic.recover_async'{}, _, _State) -> - rabbit_misc:protocol_error( - not_allowed, "attempt to recover a transactional channel",[]); handle_method(#'basic.recover'{requeue = Requeue}, Content, State) -> {noreply, State2 = #ch{writer_pid = WriterPid}} = @@ -661,7 +656,6 @@ handle_method(#'basic.recover'{requeue = Requeue}, Content, State) -> State), ok = rabbit_writer:send_command(WriterPid, #'basic.recover_ok'{}), {noreply, State2}; - handle_method(#'exchange.declare'{exchange = ExchangeNameBin, type = TypeNameBin, passive = false, -- cgit v1.2.1 From 215fb035c58c4b1211e51ee296a2ae508bb687d4 Mon Sep 17 00:00:00 2001 From: Simon MacMullen Date: Fri, 18 Jun 2010 13:23:37 +0100 Subject: Rebalance blank lines --- src/rabbit_channel.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 6caacc82..eb3dd75e 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -648,7 +648,6 @@ handle_method(#'basic.recover_async'{requeue = false}, %% variant of this method {noreply, State}; - handle_method(#'basic.recover'{requeue = Requeue}, Content, State) -> {noreply, State2 = #ch{writer_pid = WriterPid}} = handle_method(#'basic.recover_async'{requeue = Requeue}, @@ -656,6 +655,7 @@ handle_method(#'basic.recover'{requeue = Requeue}, Content, State) -> State), ok = rabbit_writer:send_command(WriterPid, #'basic.recover_ok'{}), {noreply, State2}; + handle_method(#'exchange.declare'{exchange = ExchangeNameBin, type = TypeNameBin, passive = false, -- cgit v1.2.1