summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-04-08 00:07:22 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-04-08 00:07:22 +0000
commitb4946c30a8df3326b53f58ab5c7e58dc49fa2ee8 (patch)
tree4ca44fd21732907681f7c3f0d8d47553807ad9b1 /src
parent56ae99118f5c35612fe4fc440480984ea1e7aa29 (diff)
fix last straggler view update_seq bugs, thanks tisba and bitdiddle for the report
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@931731 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_httpd_show.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl
index 134010a9..7bfb858b 100644
--- a/src/couchdb/couch_httpd_show.erl
+++ b/src/couchdb/couch_httpd_show.erl
@@ -240,7 +240,7 @@ output_map_list(Req, Db, DDoc, LName, View, QueryArgs, Etag, Keys, Group) ->
couch_httpd_view:make_key_options(QueryArgs2))
end, {ok, nil, FoldAccInit}, Keys)
end,
- finish_list(Req, QServer, Etag, FoldResult, StartListRespFun, RowCount)
+ finish_list(Req, QServer, Etag, FoldResult, StartListRespFun, CurrentSeq, RowCount)
end).
@@ -277,7 +277,7 @@ output_reduce_list(Req, Db, DDoc, LName, View, QueryArgs, Etag, Keys, Group) ->
)
end, {ok, FoldAccInit}, Keys)
end,
- finish_list(Req, QServer, Etag, FoldResult, StartListRespFun, null)
+ finish_list(Req, QServer, Etag, FoldResult, StartListRespFun, CurrentSeq, null)
end).
@@ -348,7 +348,7 @@ send_non_empty_chunk(Resp, Chunk) ->
_ -> send_chunk(Resp, Chunk)
end.
-finish_list(Req, {Proc, _DDocId}, Etag, FoldResult, StartFun, TotalRows) ->
+finish_list(Req, {Proc, _DDocId}, Etag, FoldResult, StartFun, CurrentSeq, TotalRows) ->
FoldResult2 = case FoldResult of
{Limit, SkipCount, Response, RowAcc} ->
{Limit, SkipCount, Response, RowAcc, nil};
@@ -358,7 +358,7 @@ finish_list(Req, {Proc, _DDocId}, Etag, FoldResult, StartFun, TotalRows) ->
case FoldResult2 of
{_, _, undefined, _, _} ->
{ok, Resp, BeginBody} =
- render_head_for_empty_list(StartFun, Req, Etag, TotalRows),
+ render_head_for_empty_list(StartFun, Req, Etag, CurrentSeq, TotalRows),
[<<"end">>, Chunks] = couch_query_servers:proc_prompt(Proc, [<<"list_end">>]),
Chunk = BeginBody ++ ?b2l(?l2b(Chunks)),
send_non_empty_chunk(Resp, Chunk);
@@ -371,10 +371,10 @@ finish_list(Req, {Proc, _DDocId}, Etag, FoldResult, StartFun, TotalRows) ->
last_chunk(Resp).
-render_head_for_empty_list(StartListRespFun, Req, Etag, null) ->
- StartListRespFun(Req, Etag, []); % for reduce
-render_head_for_empty_list(StartListRespFun, Req, Etag, TotalRows) ->
- StartListRespFun(Req, Etag, TotalRows, null, []).
+render_head_for_empty_list(StartListRespFun, Req, Etag, CurrentSeq, null) ->
+ StartListRespFun(Req, Etag, [], CurrentSeq); % for reduce
+render_head_for_empty_list(StartListRespFun, Req, Etag, CurrentSeq, TotalRows) ->
+ StartListRespFun(Req, Etag, TotalRows, null, [], CurrentSeq).
% Maybe this is in the proplists API