summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-11-17 14:12:23 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-11-17 14:13:05 +0000
commit3104c36670b243b22769f74fbae46c6ef413f7d2 (patch)
tree2723eaec3e53a00ce3d5325c1848a46eab1ccab2
parent4aa872359e64a51dabcf5a4d3c49f3d93e6f1def (diff)
downloadcouchdb-3104c36670b243b22769f74fbae46c6ef413f7d2.tar.gz
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.
-rw-r--r--src/couchdb/couch_api_wrap.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/couchdb/couch_api_wrap.erl b/src/couchdb/couch_api_wrap.erl
index 9e27e7dad..bb8d98325 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 ->