1TWqKb1Ac2hmKYh7VgNMLO changeset

Changeset323832636538 (b)
ParentNone (a)
ab
0+Index: src/couchdb/couch_rep_reader.erl
0+===================================================================
0+--- src/couchdb/couch_rep_reader.erl    (revision 1177549)
0++++ src/couchdb/couch_rep_reader.erl    (working copy)
0+@@ -177,7 +177,7 @@
0+     hd(State#state.opened_seqs).
0+ 
0+ split_revlist(Rev, {[CurrentAcc|Rest], BaseLength, Length}) ->
0+-    case Length+size(Rev)+3 > 8192 of
0++    case Length+size(Rev)+3 >= 8192 of
0+     false ->
0+         {[[Rev|CurrentAcc] | Rest], BaseLength, Length+size(Rev)+3};
0+     true ->
0+@@ -214,7 +214,9 @@
0+     %% MochiWeb into multiple requests
0+     BaseQS = [{revs,true}, {latest,true}, {att_encoding_info,true}],
0+     BaseReq = DbS#http_db{resource=encode_doc_id(DocId), qs=BaseQS},
0+-    BaseLength = length(couch_rep_httpc:full_url(BaseReq) ++ "&open_revs=[]"),
0++    BaseLength = length(
0++        "GET " ++ couch_rep_httpc:full_url(BaseReq) ++
0++        "&open_revs=[]" ++ " HTTP/1.1\r\n"),
0+ 
0+     {RevLists, _, _} = lists:foldl(fun split_revlist/2,
0+         {[[]], BaseLength, BaseLength}, couch_doc:revs_to_strs(Revs)),
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- Revision None
+++ Revision 323832636538
@@ -0,0 +1,24 @@
+Index: src/couchdb/couch_rep_reader.erl
+===================================================================
+--- src/couchdb/couch_rep_reader.erl (revision 1177549)
++++ src/couchdb/couch_rep_reader.erl (working copy)
+@@ -177,7 +177,7 @@
+ hd(State#state.opened_seqs).
+
+ split_revlist(Rev, {[CurrentAcc|Rest], BaseLength, Length}) ->
+- case Length+size(Rev)+3 > 8192 of
++ case Length+size(Rev)+3 >= 8192 of
+ false ->
+ {[[Rev|CurrentAcc] | Rest], BaseLength, Length+size(Rev)+3};
+ true ->
+@@ -214,7 +214,9 @@
+ %% MochiWeb into multiple requests
+ BaseQS = [{revs,true}, {latest,true}, {att_encoding_info,true}],
+ BaseReq = DbS#http_db{resource=encode_doc_id(DocId), qs=BaseQS},
+- BaseLength = length(couch_rep_httpc:full_url(BaseReq) ++ "&open_revs=[]"),
++ BaseLength = length(
++ "GET " ++ couch_rep_httpc:full_url(BaseReq) ++
++ "&open_revs=[]" ++ " HTTP/1.1\r\n"),
+
+ {RevLists, _, _} = lists:foldl(fun split_revlist/2,
+ {[[]], BaseLength, BaseLength}, couch_doc:revs_to_strs(Revs)),