Revision 323832636538 () - Diff

Link to this snippet: https://friendpaste.com/1TWqKb1Ac2hmKYh7VgNMLO
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)),