You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/11/17 15:14:50 UTC

[2/2] git commit: Fix replicator doc GET requests for many revisions

Fix replicator doc GET requests for many revisions

Mochiweb limits request lines up to 8192 characters but the
replicator wasn't accounting for the verb and protocol parts
of the first request line ("GET " + " HTTP/1.1\r\n")

Closes COUCHDB-1340.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/836c3cc1
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/836c3cc1
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/836c3cc1

Branch: refs/heads/1.2.x
Commit: 836c3cc1e02b1327327b6678be8148f5b4ba9ef1
Parents: 54b9726
Author: Filipe David Borba Manana <fd...@apache.org>
Authored: Thu Nov 17 14:12:23 2011 +0000
Committer: Filipe David Borba Manana <fd...@apache.org>
Committed: Thu Nov 17 14:13:23 2011 +0000

----------------------------------------------------------------------
 src/couchdb/couch_api_wrap.erl |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/836c3cc1/src/couchdb/couch_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_api_wrap.erl b/src/couchdb/couch_api_wrap.erl
index 9e27e7d..bb8d983 100644
--- a/src/couchdb/couch_api_wrap.erl
+++ b/src/couchdb/couch_api_wrap.erl
@@ -444,7 +444,8 @@ options_to_query_args(HttpDb, Path, Options) ->
         FullUrl = couch_api_wrap_httpc:full_url(
             HttpDb, [{path, Path}, {qs, QueryArgs1}]),
         RevList = atts_since_arg(
-            length(FullUrl) + length("&atts_since=[]"), PAs, []),
+            length("GET " ++ FullUrl ++ " HTTP/1.1\r\n") +
+            length("&atts_since=[]"), PAs, []),
         [{"atts_since", ?JSON_ENCODE(RevList)} | QueryArgs1]
     end.
 
@@ -476,7 +477,7 @@ atts_since_arg(UrlLen, [PA | Rest], Acc) ->
     _ ->
         UrlLen + size(RevStr) + 3   % plus 2 double quotes and a comma
     end,
-    case NewUrlLen > ?MAX_URL_LEN of
+    case NewUrlLen >= ?MAX_URL_LEN of
     true ->
         lists:reverse(Acc);
     false ->