summaryrefslogtreecommitdiff
path: root/src/rabbit_variable_queue.erl
diff options
context:
space:
mode:
authorFrancesco Mazzoli <francesco@rabbitmq.com>2012-04-23 16:35:43 +0100
committerFrancesco Mazzoli <francesco@rabbitmq.com>2012-04-23 16:35:43 +0100
commit5e6173aa60ae4468e0dfc8481ae1378f0af5b2eb (patch)
tree571561b82e6c0e563038e4aaf88113b78d531bce /src/rabbit_variable_queue.erl
parenta03f41b8beeca6306fc149894b9ae5680db5b0cf (diff)
downloadrabbitmq-server-5e6173aa60ae4468e0dfc8481ae1378f0af5b2eb.tar.gz
Clearer var naming in BQ:dropwhile. Fix in amqqueue_process:drop_expired_messages.
Also, corrected the dropwhile-related comments in rabbit_backing_queue. For what concerns the fix in drop_expired_messages, I was wrongly generating acktags for dead messages not to be dead-lettered.
Diffstat (limited to 'src/rabbit_variable_queue.erl')
-rw-r--r--src/rabbit_variable_queue.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index c418cc4d..ddbe6bcc 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -578,24 +578,24 @@ drain_confirmed(State = #vqstate { confirmed = C }) ->
confirmed = gb_sets:new() }}
end.
-dropwhile(Pred, AckMsgs, State) ->
- End = fun(S) when AckMsgs -> {[], S};
- (S) -> {undefined, S}
+dropwhile(Pred, AckRequired, State) ->
+ End = fun(S) when AckRequired -> {[], S};
+ (S) -> {undefined, S}
end,
case queue_out(State) of
{empty, State1} ->
End(a(State1));
{{value, MsgStatus = #msg_status { msg_props = MsgProps }}, State1} ->
- case {Pred(MsgProps), AckMsgs} of
+ case {Pred(MsgProps), AckRequired} of
{true, true} ->
{MsgStatus1, State2} = read_msg(MsgStatus, State1),
{{Msg, _, AckTag, _}, State3} =
internal_fetch(true, MsgStatus1, State2),
- {L, State4} = dropwhile(Pred, AckMsgs, State3),
+ {L, State4} = dropwhile(Pred, AckRequired, State3),
{[{Msg, AckTag} | L], State4};
{true, false} ->
{_, State2} = internal_fetch(false, MsgStatus, State1),
- dropwhile(Pred, AckMsgs, State2);
+ dropwhile(Pred, AckRequired, State2);
{false, _} ->
End(a(in_r(MsgStatus, State1)))
end