couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r1064157 - /couchdb/trunk/src/couchdb/couch_rep_reader.erl
Date Thu, 27 Jan 2011 15:24:29 GMT
Author: kocolosk
Date: Thu Jan 27 15:24:29 2011
New Revision: 1064157

URL: http://svn.apache.org/viewvc?rev=1064157&view=rev
Log:
Fix calculation of URL length in replicator

COUCHDB-644, COUCHDB-1044

Modified:
    couchdb/trunk/src/couchdb/couch_rep_reader.erl

Modified: couchdb/trunk/src/couchdb/couch_rep_reader.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_reader.erl?rev=1064157&r1=1064156&r2=1064157&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_reader.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_reader.erl Thu Jan 27 15:24:29 2011
@@ -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,
     %% 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)),



Mime
View raw message