summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-01-19 10:52:53 +0000
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-01-19 10:52:53 +0000
commit1169209a828469e61618278c83928bf989c020e8 (patch)
treed206a3a70cfdb152a00570a956288af585624b91
parentc9dc04c1ac3e2eb78c2c6bd4e83c7fb4f60950b5 (diff)
downloadrabbitmq-server-1169209a828469e61618278c83928bf989c020e8.tar.gz
fix break when stats were off
-rw-r--r--src/rabbit_channel.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index ca424335..6bbb0412 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1265,15 +1265,15 @@ lock_message(false, _MsgStruct, State) ->
State.
send_confirms(State = #ch{confirmed = C, stats_timer = StatsTimer}) ->
+ C1 = lists:append(C),
MsgSeqNos = case rabbit_event:stats_level(StatsTimer) of
- fine -> incr_confirm_exchange_stats(C, State);
- _ -> [MsgSeqNo || {MsgSeqNo, _} <- C]
+ fine -> incr_confirm_exchange_stats(C1, State);
+ _ -> [MsgSeqNo || {MsgSeqNo, _} <- C1]
end,
send_confirms(MsgSeqNos, State #ch{confirmed = []}).
send_confirms([], State) ->
State;
-send_confirms([MsgSeqNo],
- State = #ch{writer_pid = WriterPid}) ->
+send_confirms([MsgSeqNo], State = #ch{writer_pid = WriterPid}) ->
send_confirm(MsgSeqNo, WriterPid),
State;
send_confirms(Cs, State = #ch{writer_pid = WriterPid, unconfirmed = UC}) ->
@@ -1297,7 +1297,7 @@ incr_confirm_exchange_stats(C, State) ->
fun({MsgSeqNo, ExchangeName}, MsgSeqNos0) ->
maybe_incr_stats([{ExchangeName, 1}], confirm, State),
[MsgSeqNo | MsgSeqNos0]
- end, [], lists:append(C)).
+ end, [], C).
send_confirm(SeqNo, WriterPid) ->
ok = rabbit_writer:send_command(WriterPid,