summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2011-01-27 15:07:44 +0000
committerAdam Kocoloski <kocolosk@apache.org>2011-01-27 15:07:44 +0000
commit2e7ed944f2d23c2436f056e9649473cc891bd6e6 (patch)
tree43df63e899adc122f870a890720d618caae713ec /src
parent7e354ef1c1b675daff9be1a842bad1489dd6df8e (diff)
Fix calculation of URL length in replicator
COUCHDB-644, COUCHDB-1044 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1064147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/couchdb/couch_rep_reader.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couchdb/couch_rep_reader.erl b/src/couchdb/couch_rep_reader.erl
index 1bd3e171..0d344e5c 100644
--- a/src/couchdb/couch_rep_reader.erl
+++ b/src/couchdb/couch_rep_reader.erl
@@ -177,9 +177,9 @@ calculate_new_high_seq(State) ->
hd(State#state.opened_seqs).
split_revlist(Rev, {[CurrentAcc|Rest], BaseLength, Length}) ->
- case Length+size(Rev) > 8192 of
+ case Length+size(Rev)+3 > 8192 of
false ->
- {[[Rev|CurrentAcc] | Rest], BaseLength, Length+size(Rev)};
+ {[[Rev|CurrentAcc] | Rest], BaseLength, Length+size(Rev)+3};
true ->
{[[Rev],CurrentAcc|Rest], BaseLength, BaseLength}
end.
@@ -214,7 +214,7 @@ open_doc_revs(#http_db{url = Url} = DbS, DocId, Revs) ->
%% 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)) + 11, % &open_revs=
+ BaseLength = length(couch_rep_httpc:full_url(BaseReq) ++ "&open_revs=[]"),
{RevLists, _, _} = lists:foldl(fun split_revlist/2,
{[[]], BaseLength, BaseLength}, couch_doc:revs_to_strs(Revs)),