couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject [1/2] git commit: Fix replicator doc GET requests for many revisions
Date Thu, 17 Nov 2011 14:14:33 GMT
Updated Branches:
  refs/heads/master 4aa872359 -> 8bbaeea38


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/3104c366
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/3104c366
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/3104c366

Branch: refs/heads/master
Commit: 3104c36670b243b22769f74fbae46c6ef413f7d2
Parents: 4aa8723
Author: Filipe David Borba Manana <fdmanana@apache.org>
Authored: Thu Nov 17 14:12:23 2011 +0000
Committer: Filipe David Borba Manana <fdmanana@apache.org>
Committed: Thu Nov 17 14:13:05 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/3104c366/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 ->


Mime
View raw message