summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-01-13 02:43:15 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2011-01-13 02:43:15 +0000
commitc0f0300915f48a9ce78139c580a074ab8626fe0e (patch)
treef34c17d416d8772d23b96bba086652e6ef719f9d /src
parentea9872fc097435ac28622592a445230df4857053 (diff)
downloadrabbitmq-server-git-c0f0300915f48a9ce78139c580a074ab8626fe0e.tar.gz
generalise optimisation
there is never any point in trying to send a multi-ack when there is just one message to confirm
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_channel.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index c5e523ec49..5badfb050d 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1208,15 +1208,12 @@ is_message_persistent(Content) ->
process_routing_result(unroutable, _, MsgSeqNo, Message, State) ->
ok = basic_return(Message, State#ch.writer_pid, no_route),
- ok = send_confirm(MsgSeqNo, State#ch.writer_pid),
- State;
+ send_confirms([MsgSeqNo], State);
process_routing_result(not_delivered, _, MsgSeqNo, Message, State) ->
ok = basic_return(Message, State#ch.writer_pid, no_consumers),
- ok = send_confirm(MsgSeqNo, State#ch.writer_pid),
- State;
+ send_confirms([MsgSeqNo], State);
process_routing_result(routed, [], MsgSeqNo, _, State) ->
- ok = send_confirm(MsgSeqNo, State#ch.writer_pid),
- State;
+ send_confirms([MsgSeqNo], State);
process_routing_result(routed, _, undefined, _, State) ->
State;
process_routing_result(routed, QPids, MsgSeqNo, _, State) ->
@@ -1232,6 +1229,9 @@ lock_message(false, _MsgStruct, State) ->
send_confirms([], State) ->
State;
+send_confirms([MsgSeqNo], State = #ch{writer_pid = WriterPid}) ->
+ send_confirm(MsgSeqNo, WriterPid),
+ State;
send_confirms(Cs, State = #ch{writer_pid = WriterPid, unconfirmed = UC}) ->
SCs = lists:usort(Cs),
CutOff = case gb_sets:is_empty(UC) of