Skip to content
This repository has been archived by the owner on Sep 19, 2019. It is now read-only.

Commit

Permalink
Fix limit=0 timing bug dropping total/offset from response
Browse files Browse the repository at this point in the history
BugzID: 11762
  • Loading branch information
kocolosk committed Feb 1, 2011
1 parent 0e07fb0 commit 1c8af60
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/fabric_view.erl
Expand Up @@ -105,9 +105,15 @@ maybe_resume_worker(Worker, State) ->
end.

maybe_send_row(#collector{limit=0} = State) ->
#collector{user_acc=AccIn, callback=Callback} = State,
{_, Acc} = Callback(complete, AccIn),
{stop, State#collector{user_acc=Acc}};
#collector{counters=Counters, user_acc=AccIn, callback=Callback} = State,
case fabric_dict:any(0, Counters) of
true ->
% we still need to send the total/offset header
{ok, State};
false ->
{_, Acc} = Callback(complete, AccIn),
{stop, State#collector{user_acc=Acc}}
end;
maybe_send_row(State) ->
#collector{
callback = Callback,
Expand Down

0 comments on commit 1c8af60

Please sign in to comment.